MODULE OUTPUT_DATA

! Output quantity arrays

USE PRECISION_PARAMETERS
IMPLICIT NONE
CHARACTER(255), PARAMETER :: dataid='$Id: data.f90 8705 2011-07-14 21:22:31Z randy.mcdermott $'
CHARACTER(255), PARAMETER :: datarev='$Revision: 8705 $'
CHARACTER(255), PARAMETER :: datadate='$Date: 2011-07-14 22:22:31 +0100 (Thu, 14 Jul 2011) $'

INTEGER, PARAMETER :: N_OUTPUT_QUANTITIES=350
INTEGER :: PLOT3D_QUANTITY_INDEX(5),PLOT3D_Y_INDEX(5)=0,PLOT3D_Z_INDEX(5)=0,PLOT3D_PART_INDEX(5),&
           SMOKE3D_QUANTITY_INDEX,SMOKE3D_Y_INDEX=0,SMOKE3D_Z_INDEX=0,PLOT3D_VELO_INDEX(5)=0
CHARACTER(30) :: PLOT3D_QUANTITY(5),PLOT3D_SPEC_ID(5),PLOT3D_PART_ID(5),PLOT3D_SMOKEVIEW_BAR_LABEL(5), &
                 SMOKE3D_QUANTITY,SMOKE3D_SPEC_ID,SMOKE3D_SMOKEVIEW_BAR_LABEL
CHARACTER(60) :: PLOT3D_SMOKEVIEW_LABEL(5),SMOKE3D_SMOKEVIEW_LABEL
INTEGER :: N_BNDF,N_ISOF,N_PROF,N_SLCF_MAX=0
REAL(EB),ALLOCATABLE, DIMENSION(:) :: HRR,RHRR,CHRR,FHRR,FUEL_DROPLET_MLR,MLR, &
                                      HRR_SUM,RHRR_SUM,CHRR_SUM,FHRR_SUM,MLR_SUM,HRR_TIME_INTERVAL
REAL(EB),ALLOCATABLE, DIMENSION(:,:) :: MINT,MINT_SUM
REAL(EB),ALLOCATABLE, DIMENSION(:) :: MINT_TIME_INTERVAL

TYPE OUTPUT_QUANTITY_TYPE
   CHARACTER(30) :: NAME='null',SHORT_NAME='null',UNITS='null'
   REAL(EB) :: AMBIENT_VALUE=0._EB
   INTEGER :: IOR=0,CELL_POSITION=1
   LOGICAL :: SLCF_APPROPRIATE=.TRUE., BNDF_APPROPRIATE=.FALSE., ISOF_APPROPRIATE=.TRUE., PART_APPROPRIATE=.FALSE., &
              INTEGRATED=.FALSE.,SOLID_PHASE=.FALSE.,GAS_PHASE=.TRUE.,INTEGRATED_DROPLETS=.FALSE., &
              MASS_FRACTION=.FALSE.,SPEC_ID_REQUIRED=.FALSE.,PART_ID_REQUIRED=.FALSE.,INSIDE_SOLID=.FALSE., &
              MATL_ID_REQUIRED=.FALSE.,TIME_AVERAGED=.TRUE.,DEVC_APPROPRIATE=.TRUE.,&
              DUCT_ID_REQUIRED=.FALSE.,NODE_ID_REQUIRED=.FALSE.,HVAC=.FALSE.,QUANTITY2_REQUIRED=.FALSE.
END TYPE OUTPUT_QUANTITY_TYPE

TYPE (OUTPUT_QUANTITY_TYPE), DIMENSION(:), ALLOCATABLE, TARGET :: OUTPUT_QUANTITY

CONTAINS


SUBROUTINE GET_REV_data(MODULE_REV,MODULE_DATE)
INTEGER,INTENT(INOUT) :: MODULE_REV
CHARACTER(255),INTENT(INOUT) :: MODULE_DATE

WRITE(MODULE_DATE,'(A)') datarev(INDEX(datarev,':')+1:LEN_TRIM(datarev)-2)
READ (MODULE_DATE,'(I5)') MODULE_REV
WRITE(MODULE_DATE,'(A)') datadate

END SUBROUTINE GET_REV_data



SUBROUTINE DEFINE_OUTPUT_QUANTITIES

! Define all OUTPUT_QUANTITYs and their attributes

USE GLOBAL_CONSTANTS, ONLY: CELL_FACE,CELL_EDGE 
USE MEMORY_FUNCTIONS, ONLY:ChkMemErr

INTEGER :: N,IZERO

ALLOCATE(OUTPUT_QUANTITY(-N_OUTPUT_QUANTITIES:N_OUTPUT_QUANTITIES),STAT=IZERO)
CALL ChkMemErr('READ','OUTPUT_QUANTITY',IZERO) 

DO N=-N_OUTPUT_QUANTITIES,N_OUTPUT_QUANTITIES
   IF (N < 0) THEN
      OUTPUT_QUANTITY(N)%SOLID_PHASE = .TRUE.
      OUTPUT_QUANTITY(N)%ISOF_APPROPRIATE = .FALSE.
      OUTPUT_QUANTITY(N)%SLCF_APPROPRIATE = .FALSE.
      OUTPUT_QUANTITY(N)%BNDF_APPROPRIATE = .TRUE.
   ENDIF
ENDDO
 
OUTPUT_QUANTITY(0)%NAME        = 'SMOKE/WATER'             
OUTPUT_QUANTITY(0)%UNITS       = '  '                      
OUTPUT_QUANTITY(0)%SHORT_NAME  = '  '

OUTPUT_QUANTITY(1)%NAME        = 'DENSITY'                 
OUTPUT_QUANTITY(1)%UNITS       = 'kg/m3'                   
OUTPUT_QUANTITY(1)%SHORT_NAME  = 'rho'

OUTPUT_QUANTITY(2)%NAME        = 'F_X'                     
OUTPUT_QUANTITY(2)%UNITS       = 'm/s2'                    
OUTPUT_QUANTITY(2)%SHORT_NAME  = 'f_x'
OUTPUT_QUANTITY(2)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(2)%IOR = 1

OUTPUT_QUANTITY(3)%NAME  = 'F_Y'                     
OUTPUT_QUANTITY(3)%UNITS  = 'm/s2'                    
OUTPUT_QUANTITY(3)%SHORT_NAME  = 'f_y'
OUTPUT_QUANTITY(3)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(3)%IOR = 2

OUTPUT_QUANTITY(4)%NAME  = 'F_Z'                     
OUTPUT_QUANTITY(4)%UNITS  = 'm/s2'                    
OUTPUT_QUANTITY(4)%SHORT_NAME  = 'f_z'
OUTPUT_QUANTITY(4)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(4)%IOR = 3

OUTPUT_QUANTITY(5)%NAME  = 'TEMPERATURE'             
OUTPUT_QUANTITY(5)%UNITS  = 'C'                       
OUTPUT_QUANTITY(5)%SHORT_NAME  = 'temp'

OUTPUT_QUANTITY(6)%NAME  = 'U-VELOCITY'              
OUTPUT_QUANTITY(6)%UNITS  = 'm/s'                    
OUTPUT_QUANTITY(6)%SHORT_NAME  = 'U-VEL'
OUTPUT_QUANTITY(6)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(6)%IOR = 1

OUTPUT_QUANTITY(7)%NAME  = 'V-VELOCITY'              
OUTPUT_QUANTITY(7)%UNITS = 'm/s'                     
OUTPUT_QUANTITY(7)%SHORT_NAME  = 'V-VEL'
OUTPUT_QUANTITY(7)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(7)%IOR = 2

OUTPUT_QUANTITY(8)%NAME  = 'W-VELOCITY'              
OUTPUT_QUANTITY(8)%UNITS  = 'm/s'                     
OUTPUT_QUANTITY(8)%SHORT_NAME  = 'W-VEL'
OUTPUT_QUANTITY(8)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(8)%IOR = 3

OUTPUT_QUANTITY(6:8)%PART_APPROPRIATE = .TRUE.

OUTPUT_QUANTITY(9)%NAME  = 'PRESSURE'                
OUTPUT_QUANTITY(9)%UNITS  = 'Pa'                      
OUTPUT_QUANTITY(9)%SHORT_NAME  = 'pres'

OUTPUT_QUANTITY(10)%NAME = 'VELOCITY'                
OUTPUT_QUANTITY(10)%UNITS = 'm/s'                     
OUTPUT_QUANTITY(10)%SHORT_NAME = 'vel'

OUTPUT_QUANTITY(11)%NAME = 'HRRPUV'                  
OUTPUT_QUANTITY(11)%UNITS = 'kW/m3'                   
OUTPUT_QUANTITY(11)%SHORT_NAME = 'hrrpuv'

OUTPUT_QUANTITY(12)%NAME = 'H'                       
OUTPUT_QUANTITY(12)%UNITS = '(m/s)^2'                 
OUTPUT_QUANTITY(12)%SHORT_NAME = 'head'

OUTPUT_QUANTITY(14)%NAME = 'DIVERGENCE'              
OUTPUT_QUANTITY(14)%UNITS = '1/s'                     
OUTPUT_QUANTITY(14)%SHORT_NAME = 'div'

OUTPUT_QUANTITY(15)%NAME = 'MIXING TIME'              
OUTPUT_QUANTITY(15)%UNITS = 's'                     
OUTPUT_QUANTITY(15)%SHORT_NAME = 'mix'

OUTPUT_QUANTITY(16)%NAME = 'ABSORPTION COEFFICIENT'  
OUTPUT_QUANTITY(16)%UNITS = '1/m'                     
OUTPUT_QUANTITY(16)%SHORT_NAME = 'kappa'

OUTPUT_QUANTITY(17)%NAME = 'VISCOSITY'               
OUTPUT_QUANTITY(17)%UNITS = 'kg/m/s'                  
OUTPUT_QUANTITY(17)%SHORT_NAME = 'visc'
 
OUTPUT_QUANTITY(18)%NAME = 'INTEGRATED INTENSITY'       
OUTPUT_QUANTITY(18)%UNITS = 'kW/m2'                  
OUTPUT_QUANTITY(18)%SHORT_NAME = 'U'

OUTPUT_QUANTITY(19)%NAME = 'RADIATION LOSS'          
OUTPUT_QUANTITY(19)%UNITS = 'kW/m3'                   
OUTPUT_QUANTITY(19)%SHORT_NAME = 'loss'

OUTPUT_QUANTITY(20)%NAME = 'PARTICLE RADIATION LOSS'    
OUTPUT_QUANTITY(20)%UNITS = 'kW/m3'                   
OUTPUT_QUANTITY(20)%SHORT_NAME = 'part_rad'

OUTPUT_QUANTITY(21)%NAME = 'RELATIVE HUMIDITY'
OUTPUT_QUANTITY(21)%UNITS = '%'
OUTPUT_QUANTITY(21)%SHORT_NAME = 'humid'

OUTPUT_QUANTITY(22)%NAME = 'HS'                       
OUTPUT_QUANTITY(22)%UNITS = '(m/s)^2'                 
OUTPUT_QUANTITY(22)%SHORT_NAME = 'hs'

OUTPUT_QUANTITY(23)%NAME = 'KINETIC ENERGY'                
OUTPUT_QUANTITY(23)%UNITS = 'm2/s2'                     
OUTPUT_QUANTITY(23)%SHORT_NAME = 'ke'

! Strain and Vorticity
 
OUTPUT_QUANTITY(24)%NAME = 'STRAIN RATE X'           
OUTPUT_QUANTITY(24)%UNITS = '1/s'                     
OUTPUT_QUANTITY(24)%SHORT_NAME = 'strain_x'

OUTPUT_QUANTITY(25)%NAME = 'STRAIN RATE Y'           
OUTPUT_QUANTITY(25)%UNITS = '1/s'                     
OUTPUT_QUANTITY(25)%SHORT_NAME = 'strain_y'

OUTPUT_QUANTITY(26)%NAME = 'STRAIN RATE Z'           
OUTPUT_QUANTITY(26)%UNITS = '1/s'                     
OUTPUT_QUANTITY(26)%SHORT_NAME = 'strain_z'

OUTPUT_QUANTITY(27)%NAME = 'VORTICITY X'             
OUTPUT_QUANTITY(27)%UNITS = '1/s'                     
OUTPUT_QUANTITY(27)%SHORT_NAME = 'vort_x'  

OUTPUT_QUANTITY(28)%NAME = 'VORTICITY Y'             
OUTPUT_QUANTITY(28)%UNITS = '1/s'                     
OUTPUT_QUANTITY(28)%SHORT_NAME = 'vort_y'  

OUTPUT_QUANTITY(29)%NAME = 'VORTICITY Z'             
OUTPUT_QUANTITY(29)%UNITS = '1/s'                     
OUTPUT_QUANTITY(29)%SHORT_NAME = 'vort_z'  

OUTPUT_QUANTITY(24:29)%CELL_POSITION = CELL_EDGE

OUTPUT_QUANTITY(30)%NAME = 'C_SMAG'
OUTPUT_QUANTITY(30)%UNITS = '  '
OUTPUT_QUANTITY(30)%SHORT_NAME = 'c_smag'

OUTPUT_QUANTITY(31)%NAME = 'SPECIFIC HEAT'
OUTPUT_QUANTITY(31)%UNITS = 'kJ/kg/K'
OUTPUT_QUANTITY(31)%SHORT_NAME = 'c_p'

OUTPUT_QUANTITY(32)%NAME = 'HRRPUA'
OUTPUT_QUANTITY(32)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(32)%SHORT_NAME = 'hrrpua'  

OUTPUT_QUANTITY(33)%NAME = 'CONDUCTIVITY'
OUTPUT_QUANTITY(33)%UNITS = 'W/m/K'
OUTPUT_QUANTITY(33)%SHORT_NAME = 'k'

! QUANTITY's the refer to droplet properties that are used to color the droplets in Smokeview

OUTPUT_QUANTITY(34)%NAME = 'DROPLET DIAMETER'                     
OUTPUT_QUANTITY(34)%UNITS = 'mu-m'                       
OUTPUT_QUANTITY(34)%SHORT_NAME = 'diam'
 
OUTPUT_QUANTITY(35)%NAME = 'DROPLET VELOCITY'                     
OUTPUT_QUANTITY(35)%UNITS = 'm/s'                       
OUTPUT_QUANTITY(35)%SHORT_NAME = 'vel'
 
OUTPUT_QUANTITY(36)%NAME = 'DROPLET PHASE'                     
OUTPUT_QUANTITY(36)%UNITS = ' '                       
OUTPUT_QUANTITY(36)%SHORT_NAME = 'ior'
 
OUTPUT_QUANTITY(37)%NAME = 'DROPLET TEMPERATURE'                     
OUTPUT_QUANTITY(37)%UNITS = 'C'                       
OUTPUT_QUANTITY(37)%SHORT_NAME = 'temp'
 
OUTPUT_QUANTITY(38)%NAME = 'DROPLET MASS'                     
OUTPUT_QUANTITY(38)%UNITS = 'mu-g'                       
OUTPUT_QUANTITY(38)%SHORT_NAME = 'mass'
 
OUTPUT_QUANTITY(39)%NAME = 'DROPLET AGE'                     
OUTPUT_QUANTITY(39)%UNITS = 's'                       
OUTPUT_QUANTITY(39)%SHORT_NAME = 'age'

OUTPUT_QUANTITY(34:39)%PART_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(34:39)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(34:39)%DEVC_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(40)%NAME = 'MOLECULAR WEIGHT'                     
OUTPUT_QUANTITY(40)%UNITS = 'g/mol'                       
OUTPUT_QUANTITY(40)%SHORT_NAME = 'MW'

! Time and benchmarking stats

OUTPUT_QUANTITY(41)%NAME = 'TIME'
OUTPUT_QUANTITY(41)%UNITS = 's'
OUTPUT_QUANTITY(41)%SHORT_NAME = 't'

OUTPUT_QUANTITY(42)%NAME = 'TIME STEP'                       
OUTPUT_QUANTITY(42)%UNITS = 's'                 
OUTPUT_QUANTITY(42)%SHORT_NAME = 'dt'

OUTPUT_QUANTITY(43)%NAME = 'WALL CLOCK TIME'                       
OUTPUT_QUANTITY(43)%UNITS = 's'                 
OUTPUT_QUANTITY(43)%SHORT_NAME = 't_wall'

OUTPUT_QUANTITY(44)%NAME = 'CPU TIME'                       
OUTPUT_QUANTITY(44)%UNITS = 's'                 
OUTPUT_QUANTITY(44)%SHORT_NAME = 't_cpu'

OUTPUT_QUANTITY(45)%NAME = 'ITERATION'                       
OUTPUT_QUANTITY(45)%UNITS = ' '                 
OUTPUT_QUANTITY(45)%SHORT_NAME = 'step'

OUTPUT_QUANTITY(41:45)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(41:45)%ISOF_APPROPRIATE = .FALSE.

! Enthalpy

OUTPUT_QUANTITY(46)%NAME = 'SPECIFIC ENTHALPY'                       
OUTPUT_QUANTITY(46)%UNITS = 'kJ/kg'                 
OUTPUT_QUANTITY(46)%SHORT_NAME = 'h'

OUTPUT_QUANTITY(47)%NAME = 'ENTHALPY'                       
OUTPUT_QUANTITY(47)%UNITS = 'kJ/m3'                 
OUTPUT_QUANTITY(47)%SHORT_NAME = 'H'

OUTPUT_QUANTITY(48)%NAME = 'AVERAGE SPECIFIC HEAT'                       
OUTPUT_QUANTITY(48)%UNITS = 'kJ/kg/K'                 
OUTPUT_QUANTITY(48)%SHORT_NAME = 'c_p_bar'

OUTPUT_QUANTITY(49)%NAME = 'ENTHALPY ERROR'                       
OUTPUT_QUANTITY(49)%UNITS = 'kJ/m3'                 
OUTPUT_QUANTITY(49)%SHORT_NAME = 'H-rhocpT'

! Measures of turbulence resolution (diagnostics)

OUTPUT_QUANTITY(50)%NAME = 'TURBULENCE RESOLUTION'
OUTPUT_QUANTITY(50)%UNITS = '  '
OUTPUT_QUANTITY(50)%SHORT_NAME = 'mtr'

OUTPUT_QUANTITY(51)%NAME = 'SCALAR RESOLUTION'
OUTPUT_QUANTITY(51)%UNITS = '  '
OUTPUT_QUANTITY(51)%SHORT_NAME = 'msr'
OUTPUT_QUANTITY(51)%QUANTITY2_REQUIRED = .TRUE.
OUTPUT_QUANTITY(51)%SLCF_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(51)%ISOF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(52)%NAME = 'WAVELET ERROR'
OUTPUT_QUANTITY(52)%UNITS = '  '
OUTPUT_QUANTITY(52)%SHORT_NAME = 'wem'
OUTPUT_QUANTITY(52)%QUANTITY2_REQUIRED = .TRUE.
OUTPUT_QUANTITY(52)%SLCF_APPROPRIATE = .TRUE.
OUTPUT_QUANTITY(52)%ISOF_APPROPRIATE = .FALSE.

! Immersed Boundary Method

OUTPUT_QUANTITY(53)%NAME = 'UBAR'
OUTPUT_QUANTITY(53)%UNITS = 'm/s'
OUTPUT_QUANTITY(53)%SHORT_NAME = 'ubar'

! Pressure iteration info

OUTPUT_QUANTITY(55)%NAME = 'MAXIMUM VELOCITY ERROR'
OUTPUT_QUANTITY(55)%UNITS = 'm/s'
OUTPUT_QUANTITY(55)%SHORT_NAME = 'vel err'
OUTPUT_QUANTITY(55)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(55)%ISOF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(56)%NAME = 'PRESSURE ITERATIONS'
OUTPUT_QUANTITY(56)%UNITS = ' '
OUTPUT_QUANTITY(56)%SHORT_NAME = 'its'
OUTPUT_QUANTITY(56)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(56)%ISOF_APPROPRIATE = .FALSE.

! Miscellaneous outputs

OUTPUT_QUANTITY(59)%NAME = 'OPEN NOZZLES'
OUTPUT_QUANTITY(59)%UNITS = ' '
OUTPUT_QUANTITY(59)%SHORT_NAME = 'open'
OUTPUT_QUANTITY(59)%TIME_AVERAGED = .FALSE.

OUTPUT_QUANTITY(60)%NAME = 'ACTUATED SPRINKLERS'
OUTPUT_QUANTITY(60)%UNITS = ' '
OUTPUT_QUANTITY(60)%SHORT_NAME = 'act'
OUTPUT_QUANTITY(60)%TIME_AVERAGED = .FALSE.

OUTPUT_QUANTITY(61)%NAME = 'U MASK'
OUTPUT_QUANTITY(61)%UNITS = '  '
OUTPUT_QUANTITY(61)%SHORT_NAME = 'u mask'

OUTPUT_QUANTITY(62)%NAME = 'V MASK'
OUTPUT_QUANTITY(62)%UNITS = '  '
OUTPUT_QUANTITY(62)%SHORT_NAME = 'v mask'

OUTPUT_QUANTITY(63)%NAME = 'W MASK'
OUTPUT_QUANTITY(63)%UNITS = '  '
OUTPUT_QUANTITY(63)%SHORT_NAME = 'w mask'

OUTPUT_QUANTITY(64)%NAME = 'P MASK'
OUTPUT_QUANTITY(64)%UNITS = '  '
OUTPUT_QUANTITY(64)%SHORT_NAME = 'p mask'
 
! Numerical stability parameters

OUTPUT_QUANTITY(70)%NAME = 'CFL'
OUTPUT_QUANTITY(70)%UNITS = ' '
OUTPUT_QUANTITY(70)%SHORT_NAME = 'CFL'

OUTPUT_QUANTITY(71)%NAME = 'VN'
OUTPUT_QUANTITY(71)%UNITS = ' '
OUTPUT_QUANTITY(71)%SHORT_NAME = 'VN'

! Species-specific quantities that require a SPEC_ID

OUTPUT_QUANTITY(90)%NAME='MASS FRACTION'
OUTPUT_QUANTITY(90)%UNITS='kg/kg'
OUTPUT_QUANTITY(90)%MASS_FRACTION = .TRUE.
OUTPUT_QUANTITY(90)%SHORT_NAME = 'Y'

OUTPUT_QUANTITY(91)%NAME = 'MASS FLUX X'
OUTPUT_QUANTITY(91)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(91)%SHORT_NAME = 'u*rho*Y'
OUTPUT_QUANTITY(91)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(91)%IOR = 1

OUTPUT_QUANTITY(92)%NAME = 'MASS FLUX Y'
OUTPUT_QUANTITY(92)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(92)%SHORT_NAME = 'v*rho*Y'
OUTPUT_QUANTITY(92)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(92)%IOR = 2

OUTPUT_QUANTITY(93)%NAME = 'MASS FLUX Z'
OUTPUT_QUANTITY(93)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(93)%SHORT_NAME = 'w*rho*Y'
OUTPUT_QUANTITY(93)%CELL_POSITION = CELL_FACE
OUTPUT_QUANTITY(93)%IOR = 3

OUTPUT_QUANTITY(94)%NAME = 'VOLUME FRACTION'
OUTPUT_QUANTITY(94)%UNITS = 'mol/mol'
OUTPUT_QUANTITY(94)%SHORT_NAME = 'X'

OUTPUT_QUANTITY(95)%NAME = 'VISIBILITY'
OUTPUT_QUANTITY(95)%UNITS = 'm'
OUTPUT_QUANTITY(95)%SHORT_NAME = 'VIS'

OUTPUT_QUANTITY(96)%NAME = 'SOOT VOLUME FRACTION'
OUTPUT_QUANTITY(96)%UNITS = ' '
OUTPUT_QUANTITY(96)%SHORT_NAME = 'f_v'

OUTPUT_QUANTITY(97)%NAME = 'EXTINCTION COEFFICIENT'
OUTPUT_QUANTITY(97)%UNITS = '1/m'
OUTPUT_QUANTITY(97)%SHORT_NAME = 'ext_coef'

OUTPUT_QUANTITY(98)%NAME = 'OPTICAL DENSITY'
OUTPUT_QUANTITY(98)%UNITS = '1/m'
OUTPUT_QUANTITY(98)%SHORT_NAME = 'OD'

OUTPUT_QUANTITY(90:98)%SPEC_ID_REQUIRED = .TRUE.

! Miscellaneous

OUTPUT_QUANTITY(100)%NAME  = 'PRESSURE ZONE'                   
OUTPUT_QUANTITY(100)%UNITS  = ' '                    
OUTPUT_QUANTITY(100)%SHORT_NAME  = 'zone'

! Fractional Incapacitating Concentration (FIC)

OUTPUT_QUANTITY(101)%NAME  = 'FIC'
OUTPUT_QUANTITY(101)%UNITS = ''             
OUTPUT_QUANTITY(101)%SHORT_NAME  = 'fic'
OUTPUT_QUANTITY(101)%SLCF_APPROPRIATE = .TRUE.
 
! Integrated Quantities
 
OUTPUT_QUANTITY(104)%NAME  = 'HRR'                   
OUTPUT_QUANTITY(104)%UNITS  = 'kW'                    
OUTPUT_QUANTITY(104)%SHORT_NAME  = 'hrr'

OUTPUT_QUANTITY(105)%NAME  = 'LAYER HEIGHT'          
OUTPUT_QUANTITY(105)%UNITS  = 'm'                     
OUTPUT_QUANTITY(105)%SHORT_NAME  = 'layer'

OUTPUT_QUANTITY(106)%NAME  = 'UPPER TEMPERATURE'     
OUTPUT_QUANTITY(106)%UNITS  = 'C'                     
OUTPUT_QUANTITY(106)%SHORT_NAME  = 'u-tmp'

OUTPUT_QUANTITY(107)%NAME  = 'LOWER TEMPERATURE'     
OUTPUT_QUANTITY(107)%UNITS  = 'C'                     
OUTPUT_QUANTITY(107)%SHORT_NAME  = 'l-tmp'

OUTPUT_QUANTITY(104:107)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(104:107)%SLCF_APPROPRIATE = .FALSE.

! Fractional Effective Dose (FED)

OUTPUT_QUANTITY(109)%NAME  = 'FED'
OUTPUT_QUANTITY(109)%UNITS = ''             
OUTPUT_QUANTITY(109)%SHORT_NAME  = 'fed'
OUTPUT_QUANTITY(109)%SLCF_APPROPRIATE = .FALSE.

! Model of a TC

OUTPUT_QUANTITY(110)%NAME  = 'THERMOCOUPLE'          
OUTPUT_QUANTITY(110)%UNITS = 'C'                     
OUTPUT_QUANTITY(110)%SHORT_NAME  = 'tc'
 
! Mass and Energy Flows

OUTPUT_QUANTITY(111)%NAME  = 'VOLUME FLOW'
OUTPUT_QUANTITY(111)%UNITS  = 'm3/s'
OUTPUT_QUANTITY(111)%SHORT_NAME  = 'vflow'

OUTPUT_QUANTITY(112)%NAME  = 'MASS FLOW'
OUTPUT_QUANTITY(112)%UNITS  = 'kg/s'
OUTPUT_QUANTITY(112)%SHORT_NAME  = 'mflow'

OUTPUT_QUANTITY(113)%NAME  = 'HEAT FLOW'
OUTPUT_QUANTITY(113)%UNITS = 'kW'
OUTPUT_QUANTITY(113)%SHORT_NAME  = 'hflow'

OUTPUT_QUANTITY(114)%NAME  = 'VOLUME FLOW +'         
OUTPUT_QUANTITY(114)%UNITS  = 'm3/s'                  
OUTPUT_QUANTITY(114)%SHORT_NAME  = 'vflow+'

OUTPUT_QUANTITY(115)%NAME  = 'MASS FLOW +'           
OUTPUT_QUANTITY(115)%UNITS  = 'kg/s'                  
OUTPUT_QUANTITY(115)%SHORT_NAME  = 'mflow+'

OUTPUT_QUANTITY(116)%NAME  = 'HEAT FLOW +'           
OUTPUT_QUANTITY(116)%UNITS  = 'kW'                    
OUTPUT_QUANTITY(116)%SHORT_NAME  = 'hflow+'

OUTPUT_QUANTITY(117)%NAME  = 'VOLUME FLOW -'         
OUTPUT_QUANTITY(117)%UNITS  = 'm3/s'                  
OUTPUT_QUANTITY(117)%SHORT_NAME  = 'vflow-'

OUTPUT_QUANTITY(118)%NAME  = 'MASS FLOW -'           
OUTPUT_QUANTITY(118)%UNITS  = 'kg/s'                  
OUTPUT_QUANTITY(118)%SHORT_NAME  = 'mflow-'

OUTPUT_QUANTITY(119)%NAME  = 'HEAT FLOW -'           
OUTPUT_QUANTITY(119)%UNITS  = 'kW'                    
OUTPUT_QUANTITY(119)%SHORT_NAME  = 'hflow-'

OUTPUT_QUANTITY(111:119)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(111:119)%SLCF_APPROPRIATE = .FALSE.

! Special integration of HRRPUV 

OUTPUT_QUANTITY(120)%NAME  = 'HRRPUL'
OUTPUT_QUANTITY(120)%UNITS  = 'kW/m'
OUTPUT_QUANTITY(120)%SHORT_NAME  = 'hrrpul'

OUTPUT_QUANTITY(120)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(120)%SLCF_APPROPRIATE = .TRUE.

! Sprinklers and Detectors

OUTPUT_QUANTITY(155)%NAME = 'PATH OBSCURATION'
OUTPUT_QUANTITY(155)%UNITS = '%'
OUTPUT_QUANTITY(155)%SHORT_NAME = 'total obs'
OUTPUT_QUANTITY(155)%INTEGRATED = .TRUE.
OUTPUT_QUANTITY(155)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(156)%NAME = 'SPRINKLER LINK TEMPERATURE'
OUTPUT_QUANTITY(156)%UNITS = 'C'
OUTPUT_QUANTITY(156)%SHORT_NAME = 'link'
OUTPUT_QUANTITY(156)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(157)%NAME = 'LINK TEMPERATURE'
OUTPUT_QUANTITY(157)%UNITS = 'C'
OUTPUT_QUANTITY(157)%SHORT_NAME = 'link'
OUTPUT_QUANTITY(157)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(158)%NAME = 'CHAMBER OBSCURATION'
OUTPUT_QUANTITY(158)%UNITS = '%/m'
OUTPUT_QUANTITY(158)%SHORT_NAME = 'obs'
OUTPUT_QUANTITY(158)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(160)%NAME = 'CONTROL'
OUTPUT_QUANTITY(160)%UNITS = ' '
OUTPUT_QUANTITY(160)%SHORT_NAME = 'output'
OUTPUT_QUANTITY(160)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(161)%NAME = 'ASPIRATION'
OUTPUT_QUANTITY(161)%UNITS = '%/m'
OUTPUT_QUANTITY(161)%SHORT_NAME = 'obs'
OUTPUT_QUANTITY(161)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(163)%NAME = 'RADIATIVE HEAT FLUX GAS'
OUTPUT_QUANTITY(163)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(163)%SHORT_NAME = 'rad'
OUTPUT_QUANTITY(163)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(164)%NAME = 'CABLE TEMPERATURE'
OUTPUT_QUANTITY(164)%UNITS = 'C'
OUTPUT_QUANTITY(164)%SHORT_NAME = 'cable'
OUTPUT_QUANTITY(164)%SLCF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(165)%NAME = 'VELOCITY PATCH'
OUTPUT_QUANTITY(165)%UNITS = ' '
OUTPUT_QUANTITY(165)%SHORT_NAME = 'vel_patch'
OUTPUT_QUANTITY(165)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(165)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(165)%SLCF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(165)%INTEGRATED = .TRUE.

! Droplet mass quantities

OUTPUT_QUANTITY(170)%NAME = 'MPUV'
OUTPUT_QUANTITY(170)%UNITS = 'kg/m3'
OUTPUT_QUANTITY(170)%SHORT_NAME = 'mpuv'

OUTPUT_QUANTITY(171)%NAME = 'ADD'
OUTPUT_QUANTITY(171)%UNITS = 'mu-m'
OUTPUT_QUANTITY(171)%SHORT_NAME = 'diam'

OUTPUT_QUANTITY(172)%NAME = 'ADT'
OUTPUT_QUANTITY(172)%UNITS = 'C'
OUTPUT_QUANTITY(172)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(170:172)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(170:172)%PART_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(173)%NAME = 'DROPLET FLUX X'
OUTPUT_QUANTITY(173)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(173)%SHORT_NAME = 'flux_x'

OUTPUT_QUANTITY(174)%NAME = 'DROPLET FLUX Y'
OUTPUT_QUANTITY(174)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(174)%SHORT_NAME = 'flux_y'

OUTPUT_QUANTITY(175)%NAME = 'DROPLET FLUX Z'
OUTPUT_QUANTITY(175)%UNITS = 'kg/s/m2'
OUTPUT_QUANTITY(175)%SHORT_NAME = 'flux_z'

OUTPUT_QUANTITY(173:175)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(173:175)%INTEGRATED_DROPLETS = .TRUE.

! PDPA

OUTPUT_QUANTITY(231)%NAME = 'PDPA'
OUTPUT_QUANTITY(231)%UNITS = ' '
OUTPUT_QUANTITY(231)%SHORT_NAME = ' '

OUTPUT_QUANTITY(231)%ISOF_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(231)%PART_APPROPRIATE = .FALSE.
OUTPUT_QUANTITY(231)%SLCF_APPROPRIATE = .FALSE.

! EVAC

OUTPUT_QUANTITY(240)%NAME       = 'HUMAN_MOTIVE_ACCELERATION'
OUTPUT_QUANTITY(240)%UNITS      = 'm/s2'
OUTPUT_QUANTITY(240)%SHORT_NAME = 'motiveAcc'

OUTPUT_QUANTITY(241)%NAME       = 'HUMAN_FED_DOSE'
OUTPUT_QUANTITY(241)%UNITS      = '  '
OUTPUT_QUANTITY(241)%SHORT_NAME = 'FED'

OUTPUT_QUANTITY(242)%NAME       = 'HUMAN_SPEED'
OUTPUT_QUANTITY(242)%UNITS      = 'm/s'
OUTPUT_QUANTITY(242)%SHORT_NAME = 'speed'

OUTPUT_QUANTITY(243)%NAME       = 'HUMAN_ANGULAR_SPEED'
OUTPUT_QUANTITY(243)%UNITS      = 'rad/s'
OUTPUT_QUANTITY(243)%SHORT_NAME = 'omega'

OUTPUT_QUANTITY(244)%NAME       = 'HUMAN_ACCELERATION'
OUTPUT_QUANTITY(244)%UNITS      = 'm/s2'
OUTPUT_QUANTITY(244)%SHORT_NAME = 'acc'

OUTPUT_QUANTITY(245)%NAME       = 'HUMAN_CONTACT_LINEFORCE'
OUTPUT_QUANTITY(245)%UNITS      = 'N/m'
OUTPUT_QUANTITY(245)%SHORT_NAME = 'force_c'

OUTPUT_QUANTITY(246)%NAME       = 'HUMAN_TOTAL_LINEFORCE'
OUTPUT_QUANTITY(246)%UNITS      = 'N/m'
OUTPUT_QUANTITY(246)%SHORT_NAME = 'force_tot'

OUTPUT_QUANTITY(247)%NAME       = 'HUMAN_COLOR'
OUTPUT_QUANTITY(247)%UNITS      = '  '
OUTPUT_QUANTITY(247)%SHORT_NAME = 'color'

OUTPUT_QUANTITY(248)%NAME       = 'HUMAN_MOTIVE_ANGLE'
OUTPUT_QUANTITY(248)%UNITS      = 'rad'
OUTPUT_QUANTITY(248)%SHORT_NAME = 'mAngle'
OUTPUT_QUANTITY(249)%NAME       = 'HUMAN_DENSITY'
OUTPUT_QUANTITY(249)%UNITS      = '1/m2'
OUTPUT_QUANTITY(249)%SHORT_NAME = 'density'

! HVAC

OUTPUT_QUANTITY(300:350)%SLCF_APPROPRIATE=.FALSE.
OUTPUT_QUANTITY(300:350)%ISOF_APPROPRIATE=.FALSE.
OUTPUT_QUANTITY(300:350)%GAS_PHASE=.FALSE.
OUTPUT_QUANTITY(300:350)%HVAC=.TRUE.

OUTPUT_QUANTITY(300)%NAME = 'DUCT VELOCITY'
OUTPUT_QUANTITY(300)%UNITS = 'm/s'                   
OUTPUT_QUANTITY(300)%SHORT_NAME = 'vel_d'
OUTPUT_QUANTITY(300)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(301)%NAME = 'DUCT TEMPERATURE'
OUTPUT_QUANTITY(301)%UNITS = 'K'                   
OUTPUT_QUANTITY(301)%SHORT_NAME = 'temp_d'
OUTPUT_QUANTITY(301)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(302)%NAME = 'DUCT MASS FLOW'
OUTPUT_QUANTITY(302)%UNITS = 'kg/s'                   
OUTPUT_QUANTITY(302)%SHORT_NAME = 'mot_d'
OUTPUT_QUANTITY(302)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(303)%NAME = 'DUCT VOLUME FLOW'
OUTPUT_QUANTITY(303)%UNITS = 'm3/s'                   
OUTPUT_QUANTITY(303)%SHORT_NAME = 'vdot_d'
OUTPUT_QUANTITY(303)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(304)%NAME = 'DUCT MASS FRACTION'
OUTPUT_QUANTITY(304)%UNITS = 'kg/kg'                   
OUTPUT_QUANTITY(304)%SHORT_NAME = 'Y_d'
OUTPUT_QUANTITY(304)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(304)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(305)%NAME = 'DUCT VOLUME FRACTION'
OUTPUT_QUANTITY(305)%UNITS = 'mol/mol'                   
OUTPUT_QUANTITY(305)%SHORT_NAME = 'X_d'
OUTPUT_QUANTITY(305)%DUCT_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(305)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(306)%NAME = 'DUCT DENSITY'
OUTPUT_QUANTITY(306)%UNITS = 'kg/m3'                   
OUTPUT_QUANTITY(306)%SHORT_NAME = 'rho_d'
OUTPUT_QUANTITY(306)%DUCT_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(330)%NAME = 'NODE PRESSURE'
OUTPUT_QUANTITY(330)%UNITS = 'Pa'             
OUTPUT_QUANTITY(330)%SHORT_NAME = 'P_n'
OUTPUT_QUANTITY(330)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(331)%NAME = 'NODE DENSITY'
OUTPUT_QUANTITY(331)%UNITS = 'kg/m3'             
OUTPUT_QUANTITY(331)%SHORT_NAME = 'rho_n'
OUTPUT_QUANTITY(331)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(332)%NAME = 'NODE TEMPERATURE'
OUTPUT_QUANTITY(332)%UNITS = 'K'             
OUTPUT_QUANTITY(332)%SHORT_NAME = 'T_n'
OUTPUT_QUANTITY(332)%NODE_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(333)%NAME = 'NODE MASS FRACTION'
OUTPUT_QUANTITY(333)%UNITS = 'kg/kg'             
OUTPUT_QUANTITY(333)%SHORT_NAME = 'Y_n'
OUTPUT_QUANTITY(333)%NODE_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(333)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(334)%NAME = 'NODE VOLUME FRACTION'
OUTPUT_QUANTITY(334)%UNITS = 'mol/mol'             
OUTPUT_QUANTITY(334)%SHORT_NAME = 'X_n'
OUTPUT_QUANTITY(334)%NODE_ID_REQUIRED=.TRUE.
OUTPUT_QUANTITY(334)%SPEC_ID_REQUIRED=.TRUE.

OUTPUT_QUANTITY(335)%NAME = 'NODE PRESSURE DIFFERENCE'
OUTPUT_QUANTITY(335)%UNITS = 'Pa'             
OUTPUT_QUANTITY(335)%SHORT_NAME = 'deltaP'
OUTPUT_QUANTITY(335)%NODE_ID_REQUIRED=.TRUE.

! Boundary Quantities (Negative indices)
 
OUTPUT_QUANTITY(-1)%NAME = 'RADIATIVE HEAT FLUX'          
OUTPUT_QUANTITY(-1)%UNITS = 'kW/m2'                   
OUTPUT_QUANTITY(-1)%SHORT_NAME = 'rad'

OUTPUT_QUANTITY(-2)%NAME = 'CONVECTIVE HEAT FLUX'         
OUTPUT_QUANTITY(-2)%UNITS = 'kW/m2'                   
OUTPUT_QUANTITY(-2)%SHORT_NAME = 'con'

OUTPUT_QUANTITY(-3)%NAME = 'NORMAL VELOCITY'         
OUTPUT_QUANTITY(-3)%UNITS = 'm/s'                     
OUTPUT_QUANTITY(-3)%SHORT_NAME = 'vel'

OUTPUT_QUANTITY(-4)%NAME = 'GAS TEMPERATURE'         
OUTPUT_QUANTITY(-4)%UNITS = 'C'                       
OUTPUT_QUANTITY(-4)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(-5)%NAME = 'WALL TEMPERATURE'        
OUTPUT_QUANTITY(-5)%UNITS = 'C'                       
OUTPUT_QUANTITY(-5)%SHORT_NAME = 'temp'

OUTPUT_QUANTITY(-6)%NAME = 'INSIDE WALL TEMPERATURE' 
OUTPUT_QUANTITY(-6)%UNITS = 'C'                       
OUTPUT_QUANTITY(-6)%SHORT_NAME = 'inside'
OUTPUT_QUANTITY(-6)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-6)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-7)%NAME = 'BURNING RATE'            
OUTPUT_QUANTITY(-7)%UNITS = 'kg/m2/s'                 
OUTPUT_QUANTITY(-7)%SHORT_NAME = 'burn'

OUTPUT_QUANTITY(-8)%NAME = 'HRRPUM'            
OUTPUT_QUANTITY(-8)%UNITS = 'kW/kg'                 
OUTPUT_QUANTITY(-8)%SHORT_NAME = 'hrrpum'

OUTPUT_QUANTITY(-10)%NAME= 'NET HEAT FLUX'               
OUTPUT_QUANTITY(-10)%UNITS= 'kW/m2'                   
OUTPUT_QUANTITY(-10)%SHORT_NAME= 'net'

OUTPUT_QUANTITY(-11)%NAME= 'PRESSURE COEFFICIENT'    
OUTPUT_QUANTITY(-11)%UNITS= ' '                       
OUTPUT_QUANTITY(-11)%SHORT_NAME= 'c_p'

OUTPUT_QUANTITY(-12)%NAME= 'BACK WALL TEMPERATURE'   
OUTPUT_QUANTITY(-12)%UNITS= 'C'                       
OUTPUT_QUANTITY(-12)%SHORT_NAME= 'back'

OUTPUT_QUANTITY(-13)%NAME= 'GAUGE HEAT FLUX'         
OUTPUT_QUANTITY(-13)%UNITS= 'kW/m2'                   
OUTPUT_QUANTITY(-13)%SHORT_NAME= 'gauge'

OUTPUT_QUANTITY(-19)%NAME= 'INCIDENT HEAT FLUX'      
OUTPUT_QUANTITY(-19)%UNITS= 'kW/m2'                   
OUTPUT_QUANTITY(-19)%SHORT_NAME= 'in_flux'
 
OUTPUT_QUANTITY(-20)%NAME = 'MASS FLUX'
OUTPUT_QUANTITY(-20)%UNITS= 'kg/s/m2'
OUTPUT_QUANTITY(-20)%SHORT_NAME = 'mass_flux'
OUTPUT_QUANTITY(-20)%SPEC_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(-21)%NAME= 'HEAT TRANSFER COEFFICIENT'    
OUTPUT_QUANTITY(-21)%UNITS= 'W/m2/K'                  
OUTPUT_QUANTITY(-21)%SHORT_NAME= 'h'

OUTPUT_QUANTITY(-22)%NAME= 'RADIOMETER'    
OUTPUT_QUANTITY(-22)%UNITS= 'kW/m2'                  
OUTPUT_QUANTITY(-22)%SHORT_NAME= 'radio'

OUTPUT_QUANTITY(-23)%NAME= 'ADIABATIC SURFACE TEMPERATURE'    
OUTPUT_QUANTITY(-23)%UNITS= 'C'                  
OUTPUT_QUANTITY(-23)%SHORT_NAME= 'AST'

OUTPUT_QUANTITY(-24)%NAME= 'WALL THICKNESS'    
OUTPUT_QUANTITY(-24)%UNITS= 'm'      
OUTPUT_QUANTITY(-24)%SHORT_NAME= 'thick'

OUTPUT_QUANTITY(-25)%NAME= 'SURFACE DENSITY'
OUTPUT_QUANTITY(-25)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-25)%SHORT_NAME= 'dens'

OUTPUT_QUANTITY(-26)%NAME= 'SOLID DENSITY'
OUTPUT_QUANTITY(-26)%UNITS= 'kg/m3'
OUTPUT_QUANTITY(-26)%SHORT_NAME= 'rho_s'
OUTPUT_QUANTITY(-26)%MATL_ID_REQUIRED = .TRUE.
OUTPUT_QUANTITY(-26)%INSIDE_SOLID = .TRUE.
OUTPUT_QUANTITY(-26)%BNDF_APPROPRIATE = .FALSE.

OUTPUT_QUANTITY(-27)%NAME= 'EMISSIVITY'
OUTPUT_QUANTITY(-27)%UNITS= ''
OUTPUT_QUANTITY(-27)%SHORT_NAME= 'emiss'

OUTPUT_QUANTITY(-28)%NAME= 'SOOT SURFACE DENSITY'
OUTPUT_QUANTITY(-28)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-28)%SHORT_NAME= 'soot den'

! Solid Phase Particle Outputs

OUTPUT_QUANTITY(-30)%NAME = 'MPUA'
OUTPUT_QUANTITY(-30)%UNITS = 'kg/m2'
OUTPUT_QUANTITY(-30)%SHORT_NAME = 'mpua'

OUTPUT_QUANTITY(-31)%NAME = 'CPUA'
OUTPUT_QUANTITY(-31)%UNITS = 'kW/m2'
OUTPUT_QUANTITY(-31)%SHORT_NAME = 'cpua'

OUTPUT_QUANTITY(-32)%NAME = 'AMPUA'
OUTPUT_QUANTITY(-32)%UNITS= 'kg/m2'
OUTPUT_QUANTITY(-32)%SHORT_NAME = 'ampua'

OUTPUT_QUANTITY(-32:-30)%PART_ID_REQUIRED = .TRUE.

OUTPUT_QUANTITY(-33)%NAME= 'SOLID SPECIFIC HEAT'
OUTPUT_QUANTITY(-33)%UNITS= 'kJ/kg/K'
OUTPUT_QUANTITY(-33)%SHORT_NAME= 'cp_s'
OUTPUT_QUANTITY(-33)%INSIDE_SOLID = .TRUE.

OUTPUT_QUANTITY(-34)%NAME= 'SOLID CONDUCTIVITY'
OUTPUT_QUANTITY(-34)%UNITS= 'W/m/K'
OUTPUT_QUANTITY(-34)%SHORT_NAME= 'k_s'
OUTPUT_QUANTITY(-34)%INSIDE_SOLID = .TRUE.

END SUBROUTINE DEFINE_OUTPUT_QUANTITIES


SUBROUTINE SET_QUANTITIES_AMBIENT
USE GLOBAL_CONSTANTS, ONLY: RHOA,TMPA,TMPM 
! Define OUTPUT_QUANTITYs that have fixed names

OUTPUT_QUANTITY(1)%AMBIENT_VALUE = RHOA
OUTPUT_QUANTITY(5)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(110)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(-6:-4)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(-12)%AMBIENT_VALUE = TMPA-TMPM
OUTPUT_QUANTITY(-23)%AMBIENT_VALUE = TMPA-TMPM

END SUBROUTINE SET_QUANTITIES_AMBIENT


SUBROUTINE COLOR2RGB(RGB,COLOR)
USE COMP_FUNCTIONS, ONLY:SHUTDOWN
! Translate character string of a color name to RGB value

INTEGER :: RGB(3)
CHARACTER(25) :: COLOR
CHARACTER(100) :: MESSAGE

SELECT CASE(COLOR)
CASE ('ALICE BLUE');RGB = (/240,248,255/)
CASE ('ANTIQUE WHITE');RGB = (/250,235,215/)
CASE ('ANTIQUE WHITE 1');RGB = (/255,239,219/)
CASE ('ANTIQUE WHITE 2');RGB = (/238,223,204/)
CASE ('ANTIQUE WHITE 3');RGB = (/205,192,176/)
CASE ('ANTIQUE WHITE 4');RGB = (/139,131,120/)
CASE ('AQUAMARINE');RGB = (/127,255,212/)
CASE ('AQUAMARINE 1');RGB = (/118,238,198/)
CASE ('AQUAMARINE 2');RGB = (/102,205,170/)
CASE ('AQUAMARINE 3');RGB = (/69,139,116/)
CASE ('AZURE');RGB = (/240,255,255/)
CASE ('AZURE 1');RGB = (/224,238,238/)
CASE ('AZURE 2');RGB = (/193,205,205/)
CASE ('AZURE 3');RGB = (/131,139,139/)
CASE ('BANANA');RGB = (/227,207,87/)
CASE ('BEIGE');RGB = (/245,245,220/)
CASE ('BISQUE');RGB = (/255,228,196/)
CASE ('BISQUE 1');RGB = (/238,213,183/)
CASE ('BISQUE 2');RGB = (/205,183,158/)
CASE ('BISQUE 3');RGB = (/139,125,107/)
CASE ('BLACK');RGB = (/0,0,0/)
CASE ('BLANCHED ALMOND');RGB = (/255,235,205/)
CASE ('BLUE');RGB = (/0,0,255/)
CASE ('BLUE 2');RGB = (/0,0,238/)
CASE ('BLUE 3');RGB = (/0,0,205/)
CASE ('BLUE 4');RGB = (/0,0,139/)
CASE ('BLUE VIOLET');RGB = (/138,43,226/)
CASE ('BRICK');RGB = (/156,102,31/)
CASE ('BROWN');RGB = (/165,42,42/)
CASE ('BROWN 1');RGB = (/255,64,64/)
CASE ('BROWN 2');RGB = (/238,59,59/)
CASE ('BROWN 3');RGB = (/205,51,51/)
CASE ('BROWN 4');RGB = (/139,35,35/)
CASE ('BURLY WOOD');RGB = (/222,184,135/)
CASE ('BURLY WOOD 1');RGB = (/255,211,155/)
CASE ('BURLY WOOD 2');RGB = (/238,197,145/)
CASE ('BURLY WOOD 3');RGB = (/205,170,125/)
CASE ('BURLY WOOD 4');RGB = (/139,115,85/)
CASE ('BURNT SIENNA');RGB = (/138,54,15/)
CASE ('BURNT UMBER');RGB = (/138,51,36/)
CASE ('CADET BLUE');RGB = (/95,158,160/)
CASE ('CADET BLUE 1');RGB = (/152,245,255/)
CASE ('CADET BLUE 2');RGB = (/142,229,238/)
CASE ('CADET BLUE 3');RGB = (/122,197,205/)
CASE ('CADET BLUE 4');RGB = (/83,134,139/)
CASE ('CADMIUM ORANGE');RGB = (/255,97,3/)
CASE ('CADMIUM YELLOW');RGB = (/255,153,18/)
CASE ('CARROT');RGB = (/237,145,33/)
CASE ('CHARTREUSE');RGB = (/127,255,0/)
CASE ('CHARTREUSE 1');RGB = (/118,238,0/)
CASE ('CHARTREUSE 2');RGB = (/102,205,0/)
CASE ('CHARTREUSE 3');RGB = (/69,139,0/)
CASE ('CHOCOLATE');RGB = (/210,105,30/)
CASE ('CHOCOLATE 1');RGB = (/255,127,36/)
CASE ('CHOCOLATE 2');RGB = (/238,118,33/)
CASE ('CHOCOLATE 3');RGB = (/205,102,29/)
CASE ('CHOCOLATE 4');RGB = (/139,69,19/)
CASE ('COBALT');RGB = (/61,89,171/)
CASE ('COBALT GREEN');RGB = (/61,145,64/)
CASE ('COLD GREY');RGB = (/128,138,135/)
CASE ('CORAL');RGB = (/255,127,80/)
CASE ('CORAL 1');RGB = (/255,114,86/)
CASE ('CORAL 2');RGB = (/238,106,80/)
CASE ('CORAL 3');RGB = (/205,91,69/)
CASE ('CORAL 4');RGB = (/139,62,47/)
CASE ('CORNFLOWER BLUE');RGB = (/100,149,237/)
CASE ('CORNSILK');RGB = (/255,248,220/)
CASE ('CORNSILK 1');RGB = (/238,232,205/)
CASE ('CORNSILK 2');RGB = (/205,200,177/)
CASE ('CORNSILK 3');RGB = (/139,136,120/)
CASE ('CRIMSON');RGB = (/220,20,60/)
CASE ('CYAN');RGB = (/0,255,255/)
CASE ('CYAN 2');RGB = (/0,238,238/)
CASE ('CYAN 3');RGB = (/0,205,205/)
CASE ('CYAN 4');RGB = (/0,139,139/)
CASE ('DARK GOLDENROD');RGB = (/184,134,11/)
CASE ('DARK GOLDENROD 1');RGB = (/255,185,15/)
CASE ('DARK GOLDENROD 2');RGB = (/238,173,14/)
CASE ('DARK GOLDENROD 3');RGB = (/205,149,12/)
CASE ('DARK GOLDENROD 4');RGB = (/139,101,8/)
CASE ('DARK GRAY');RGB = (/169,169,169/)
CASE ('DARK GREEN');RGB = (/0,100,0/)
CASE ('DARK KHAKI');RGB = (/189,183,107/)
CASE ('DARK OLIVE GREEN');RGB = (/85,107,47/)
CASE ('DARK OLIVE GREEN 1');RGB = (/202,255,112/)
CASE ('DARK OLIVE GREEN 2');RGB = (/188,238,104/)
CASE ('DARK OLIVE GREEN 3');RGB = (/162,205,90/)
CASE ('DARK OLIVE GREEN 4');RGB = (/110,139,61/)
CASE ('DARK ORANGE');RGB = (/255,140,0/)
CASE ('DARK ORANGE 1');RGB = (/255,127,0/)
CASE ('DARK ORANGE 2');RGB = (/238,118,0/)
CASE ('DARK ORANGE 3');RGB = (/205,102,0/)
CASE ('DARK ORANGE 4');RGB = (/139,69,0/)
CASE ('DARK ORCHID');RGB = (/153,50,204/)
CASE ('DARK ORCHID 1');RGB = (/191,62,255/)
CASE ('DARK ORCHID 2');RGB = (/178,58,238/)
CASE ('DARK ORCHID 3');RGB = (/154,50,205/)
CASE ('DARK ORCHID 4');RGB = (/104,34,139/)
CASE ('DARK SALMON');RGB = (/233,150,122/)
CASE ('DARK SEA GREEN');RGB = (/143,188,143/)
CASE ('DARK SEA GREEN 1');RGB = (/193,255,193/)
CASE ('DARK SEA GREEN 2');RGB = (/180,238,180/)
CASE ('DARK SEA GREEN 3');RGB = (/155,205,155/)
CASE ('DARK SEA GREEN 4');RGB = (/105,139,105/)
CASE ('DARK SLATE BLUE');RGB = (/72,61,139/)
CASE ('DARK SLATE GRAY');RGB = (/47,79,79/)
CASE ('DARK SLATE GRAY 1');RGB = (/151,255,255/)
CASE ('DARK SLATE GRAY 2');RGB = (/141,238,238/)
CASE ('DARK SLATE GRAY 3');RGB = (/121,205,205/)
CASE ('DARK SLATE GRAY 4');RGB = (/82,139,139/)
CASE ('DARK TURQUOISE');RGB = (/0,206,209/)
CASE ('DARK VIOLET');RGB = (/148,0,211/)
CASE ('DEEP PINK');RGB = (/255,20,147/)
CASE ('DEEP PINK 1');RGB = (/238,18,137/)
CASE ('DEEP PINK 2');RGB = (/205,16,118/)
CASE ('DEEP PINK 3');RGB = (/139,10,80/)
CASE ('DEEP SKYBLUE');RGB = (/0,191,255/)
CASE ('DEEP SKYBLUE 1');RGB = (/0,178,238/)
CASE ('DEEP SKYBLUE 2');RGB = (/0,154,205/)
CASE ('DEEP SKYBLUE 3');RGB = (/0,104,139/)
CASE ('DIM GRAY');RGB = (/105,105,105/)
CASE ('DODGERBLUE');RGB = (/30,144,255/)
CASE ('DODGERBLUE 1');RGB = (/28,134,238/)
CASE ('DODGERBLUE 2');RGB = (/24,116,205/)
CASE ('DODGERBLUE 3');RGB = (/16,78,139/)
CASE ('EGGSHELL');RGB = (/252,230,201/)
CASE ('EMERALD GREEN');RGB = (/0,201,87/)
CASE ('FIREBRICK');RGB = (/178,34,34/)
CASE ('FIREBRICK 1');RGB = (/255,48,48/)
CASE ('FIREBRICK 2');RGB = (/238,44,44/)
CASE ('FIREBRICK 3');RGB = (/205,38,38/)
CASE ('FIREBRICK 4');RGB = (/139,26,26/)
CASE ('FLESH');RGB = (/255,125,64/)
CASE ('FLORAL WHITE');RGB = (/255,250,240/)
CASE ('FOREST GREEN');RGB = (/34,139,34/)
CASE ('GAINSBORO');RGB = (/220,220,220/)
CASE ('GHOST WHITE');RGB = (/248,248,255/)
CASE ('GOLD');RGB = (/255,215,0/)
CASE ('GOLD 1');RGB = (/238,201,0/)
CASE ('GOLD 2');RGB = (/205,173,0/)
CASE ('GOLD 3');RGB = (/139,117,0/)
CASE ('GOLDENROD');RGB = (/218,165,32/)
CASE ('GOLDENROD 1');RGB = (/255,193,37/)
CASE ('GOLDENROD 2');RGB = (/238,180,34/)
CASE ('GOLDENROD 3');RGB = (/205,155,29/)
CASE ('GOLDENROD 4');RGB = (/139,105,20/)
CASE ('GRAY');RGB = (/128,128,128/)
CASE ('GRAY 1');RGB = (/3,3,3/)
CASE ('GRAY 10');RGB = (/26,26,26/)
CASE ('GRAY 11');RGB = (/28,28,28/)
CASE ('GRAY 12');RGB = (/31,31,31/)
CASE ('GRAY 13');RGB = (/33,33,33/)
CASE ('GRAY 14');RGB = (/36,36,36/)
CASE ('GRAY 15');RGB = (/38,38,38/)
CASE ('GRAY 16');RGB = (/41,41,41/)
CASE ('GRAY 17');RGB = (/43,43,43/)
CASE ('GRAY 18');RGB = (/46,46,46/)
CASE ('GRAY 19');RGB = (/48,48,48/)
CASE ('GRAY 2');RGB = (/5,5,5/)
CASE ('GRAY 20');RGB = (/51,51,51/)
CASE ('GRAY 21');RGB = (/54,54,54/)
CASE ('GRAY 22');RGB = (/56,56,56/)
CASE ('GRAY 23');RGB = (/59,59,59/)
CASE ('GRAY 24');RGB = (/61,61,61/)
CASE ('GRAY 25');RGB = (/64,64,64/)
CASE ('GRAY 26');RGB = (/66,66,66/)
CASE ('GRAY 27');RGB = (/69,69,69/)
CASE ('GRAY 28');RGB = (/71,71,71/)
CASE ('GRAY 29');RGB = (/74,74,74/)
CASE ('GRAY 3');RGB = (/8,8,8/)
CASE ('GRAY 30');RGB = (/77,77,77/)
CASE ('GRAY 31');RGB = (/79,79,79/)
CASE ('GRAY 32');RGB = (/82,82,82/)
CASE ('GRAY 33');RGB = (/84,84,84/)
CASE ('GRAY 34');RGB = (/87,87,87/)
CASE ('GRAY 35');RGB = (/89,89,89/)
CASE ('GRAY 36');RGB = (/92,92,92/)
CASE ('GRAY 37');RGB = (/94,94,94/)
CASE ('GRAY 38');RGB = (/97,97,97/)
CASE ('GRAY 39');RGB = (/99,99,99/)
CASE ('GRAY 4');RGB = (/10,10,10/)
CASE ('GRAY 40');RGB = (/102,102,102/)
CASE ('GRAY 42');RGB = (/107,107,107/)
CASE ('GRAY 43');RGB = (/110,110,110/)
CASE ('GRAY 44');RGB = (/112,112,112/)
CASE ('GRAY 45');RGB = (/115,115,115/)
CASE ('GRAY 46');RGB = (/117,117,117/)
CASE ('GRAY 47');RGB = (/120,120,120/)
CASE ('GRAY 48');RGB = (/122,122,122/)
CASE ('GRAY 49');RGB = (/125,125,125/)
CASE ('GRAY 5');RGB = (/13,13,13/)
CASE ('GRAY 50');RGB = (/127,127,127/)
CASE ('GRAY 51');RGB = (/130,130,130/)
CASE ('GRAY 52');RGB = (/133,133,133/)
CASE ('GRAY 53');RGB = (/135,135,135/)
CASE ('GRAY 54');RGB = (/138,138,138/)
CASE ('GRAY 55');RGB = (/140,140,140/)
CASE ('GRAY 56');RGB = (/143,143,143/)
CASE ('GRAY 57');RGB = (/145,145,145/)
CASE ('GRAY 58');RGB = (/148,148,148/)
CASE ('GRAY 59');RGB = (/150,150,150/)
CASE ('GRAY 6');RGB = (/15,15,15/)
CASE ('GRAY 60');RGB = (/153,153,153/)
CASE ('GRAY 61');RGB = (/156,156,156/)
CASE ('GRAY 62');RGB = (/158,158,158/)
CASE ('GRAY 63');RGB = (/161,161,161/)
CASE ('GRAY 64');RGB = (/163,163,163/)
CASE ('GRAY 65');RGB = (/166,166,166/)
CASE ('GRAY 66');RGB = (/168,168,168/)
CASE ('GRAY 67');RGB = (/171,171,171/)
CASE ('GRAY 68');RGB = (/173,173,173/)
CASE ('GRAY 69');RGB = (/176,176,176/)
CASE ('GRAY 7');RGB = (/18,18,18/)
CASE ('GRAY 70');RGB = (/179,179,179/)
CASE ('GRAY 71');RGB = (/181,181,181/)
CASE ('GRAY 72');RGB = (/184,184,184/)
CASE ('GRAY 73');RGB = (/186,186,186/)
CASE ('GRAY 74');RGB = (/189,189,189/)
CASE ('GRAY 75');RGB = (/191,191,191/)
CASE ('GRAY 76');RGB = (/194,194,194/)
CASE ('GRAY 77');RGB = (/196,196,196/)
CASE ('GRAY 78');RGB = (/199,199,199/)
CASE ('GRAY 79');RGB = (/201,201,201/)
CASE ('GRAY 8');RGB = (/20,20,20/)
CASE ('GRAY 80');RGB = (/204,204,204/)
CASE ('GRAY 81');RGB = (/207,207,207/)
CASE ('GRAY 82');RGB = (/209,209,209/)
CASE ('GRAY 83');RGB = (/212,212,212/)
CASE ('GRAY 84');RGB = (/214,214,214/)
CASE ('GRAY 85');RGB = (/217,217,217/)
CASE ('GRAY 86');RGB = (/219,219,219/)
CASE ('GRAY 87');RGB = (/222,222,222/)
CASE ('GRAY 88');RGB = (/224,224,224/)
CASE ('GRAY 89');RGB = (/227,227,227/)
CASE ('GRAY 9');RGB = (/23,23,23/)
CASE ('GRAY 90');RGB = (/229,229,229/)
CASE ('GRAY 91');RGB = (/232,232,232/)
CASE ('GRAY 92');RGB = (/235,235,235/)
CASE ('GRAY 93');RGB = (/237,237,237/)
CASE ('GRAY 94');RGB = (/240,240,240/)
CASE ('GRAY 95');RGB = (/242,242,242/)
CASE ('GRAY 97');RGB = (/247,247,247/)
CASE ('GRAY 98');RGB = (/250,250,250/)
CASE ('GRAY 99');RGB = (/252,252,252/)
CASE ('GREEN');RGB = (/0,255,0/)
CASE ('GREEN 2');RGB = (/0,238,0/)
CASE ('GREEN 3');RGB = (/0,205,0/)
CASE ('GREEN 4');RGB = (/0,139,0/)
CASE ('GREEN YELLOW');RGB = (/173,255,47/)
CASE ('HONEYDEW');RGB = (/240,255,240/)
CASE ('HONEYDEW 1');RGB = (/224,238,224/)
CASE ('HONEYDEW 2');RGB = (/193,205,193/)
CASE ('HONEYDEW 3');RGB = (/131,139,131/)
CASE ('HOT PINK');RGB = (/255,105,180/)
CASE ('HOT PINK 1');RGB = (/255,110,180/)
CASE ('HOT PINK 2');RGB = (/238,106,167/)
CASE ('HOT PINK 3');RGB = (/205,96,144/)
CASE ('HOT PINK 4');RGB = (/139,58,98/)
CASE ('INDIAN RED');RGB = (/205,92,92/)
CASE ('INDIAN RED 1');RGB = (/255,106,106/)
CASE ('INDIAN RED 2');RGB = (/238,99,99/)
CASE ('INDIAN RED 3');RGB = (/205,85,85/)
CASE ('INDIAN RED 4');RGB = (/139,58,58/)
CASE ('INDIGO');RGB = (/75,0,130/)
CASE ('IVORY');RGB = (/255,255,240/)
CASE ('IVORY 1');RGB = (/238,238,224/)
CASE ('IVORY 2');RGB = (/205,205,193/)
CASE ('IVORY 3');RGB = (/139,139,131/)
CASE ('IVORY BLACK');RGB = (/41,36,33/)
CASE ('KELLY GREEN');RGB = (/0,128,0/)
CASE ('KHAKI');RGB = (/240,230,140/)
CASE ('KHAKI 1');RGB = (/255,246,143/)
CASE ('KHAKI 2');RGB = (/238,230,133/)
CASE ('KHAKI 3');RGB = (/205,198,115/)
CASE ('KHAKI 4');RGB = (/139,134,78/)
CASE ('LAVENDER');RGB = (/230,230,250/)
CASE ('LAVENDER BLUSH');RGB = (/255,240,245/)
CASE ('LAVENDER BLUSH 1');RGB = (/238,224,229/)
CASE ('LAVENDER BLUSH 2');RGB = (/205,193,197/)
CASE ('LAVENDER BLUSH 3');RGB = (/139,131,134/)
CASE ('LAWN GREEN');RGB = (/124,252,0/)
CASE ('LEMON CHIFFON');RGB = (/255,250,205/)
CASE ('LEMON CHIFFON 1');RGB = (/238,233,191/)
CASE ('LEMON CHIFFON 2');RGB = (/205,201,165/)
CASE ('LEMON CHIFFON 3');RGB = (/139,137,112/)
CASE ('LIGHT BLUE');RGB = (/173,216,230/)
CASE ('LIGHT BLUE 1');RGB = (/191,239,255/)
CASE ('LIGHT BLUE 2');RGB = (/178,223,238/)
CASE ('LIGHT BLUE 3');RGB = (/154,192,205/)
CASE ('LIGHT BLUE 4');RGB = (/104,131,139/)
CASE ('LIGHT CORAL');RGB = (/240,128,128/)
CASE ('LIGHT CYAN');RGB = (/224,255,255/)
CASE ('LIGHT CYAN 1');RGB = (/209,238,238/)
CASE ('LIGHT CYAN 2');RGB = (/180,205,205/)
CASE ('LIGHT CYAN 3');RGB = (/122,139,139/)
CASE ('LIGHT GOLDENROD');RGB = (/255,236,139/)
CASE ('LIGHT GOLDENROD 1');RGB = (/238,220,130/)
CASE ('LIGHT GOLDENROD 2');RGB = (/205,190,112/)
CASE ('LIGHT GOLDENROD 3');RGB = (/139,129,76/)
CASE ('LIGHT GOLDENROD YELLOW');RGB = (/250,250,210/)
CASE ('LIGHT GREY');RGB = (/211,211,211/)
CASE ('LIGHT PINK');RGB = (/255,182,193/)
CASE ('LIGHT PINK 1');RGB = (/255,174,185/)
CASE ('LIGHT PINK 2');RGB = (/238,162,173/)
CASE ('LIGHT PINK 3');RGB = (/205,140,149/)
CASE ('LIGHT PINK 4');RGB = (/139,95,101/)
CASE ('LIGHT SALMON');RGB = (/255,160,122/)
CASE ('LIGHT SALMON 1');RGB = (/238,149,114/)
CASE ('LIGHT SALMON 2');RGB = (/205,129,98/)
CASE ('LIGHT SALMON 3');RGB = (/139,87,66/)
CASE ('LIGHT SEA GREEN');RGB = (/32,178,170/)
CASE ('LIGHT SKY BLUE');RGB = (/135,206,250/)
CASE ('LIGHT SKY BLUE 1');RGB = (/176,226,255/)
CASE ('LIGHT SKY BLUE 2');RGB = (/164,211,238/)
CASE ('LIGHT SKY BLUE 3');RGB = (/141,182,205/)
CASE ('LIGHT SKY BLUE 4');RGB = (/96,123,139/)
CASE ('LIGHT SLATE BLUE');RGB = (/132,112,255/)
CASE ('LIGHT SLATE GRAY');RGB = (/119,136,153/)
CASE ('LIGHT STEEL BLUE');RGB = (/176,196,222/)
CASE ('LIGHT STEEL BLUE 1');RGB = (/202,225,255/)
CASE ('LIGHT STEEL BLUE 2');RGB = (/188,210,238/)
CASE ('LIGHT STEEL BLUE 3');RGB = (/162,181,205/)
CASE ('LIGHT STEEL BLUE 4');RGB = (/110,123,139/)
CASE ('LIGHT YELLOW 1');RGB = (/255,255,224/)
CASE ('LIGHT YELLOW 2');RGB = (/238,238,209/)
CASE ('LIGHT YELLOW 3');RGB = (/205,205,180/)
CASE ('LIGHT YELLOW 4');RGB = (/139,139,122/)
CASE ('LIME GREEN');RGB = (/50,205,50/)
CASE ('LINEN');RGB = (/250,240,230/)
CASE ('MAGENTA');RGB = (/255,0,255/)
CASE ('MAGENTA 2');RGB = (/238,0,238/)
CASE ('MAGENTA 3');RGB = (/205,0,205/)
CASE ('MAGENTA 4');RGB = (/139,0,139/)
CASE ('MANGANESE BLUE');RGB = (/3,168,158/)
CASE ('MAROON');RGB = (/128,0,0/)
CASE ('MAROON 1');RGB = (/255,52,179/)
CASE ('MAROON 2');RGB = (/238,48,167/)
CASE ('MAROON 3');RGB = (/205,41,144/)
CASE ('MAROON 4');RGB = (/139,28,98/)
CASE ('MEDIUM ORCHID');RGB = (/186,85,211/)
CASE ('MEDIUM ORCHID 1');RGB = (/224,102,255/)
CASE ('MEDIUM ORCHID 2');RGB = (/209,95,238/)
CASE ('MEDIUM ORCHID 3');RGB = (/180,82,205/)
CASE ('MEDIUM ORCHID 4');RGB = (/122,55,139/)
CASE ('MEDIUM PURPLE');RGB = (/147,112,219/)
CASE ('MEDIUM PURPLE 1');RGB = (/171,130,255/)
CASE ('MEDIUM PURPLE 2');RGB = (/159,121,238/)
CASE ('MEDIUM PURPLE 3');RGB = (/137,104,205/)
CASE ('MEDIUM PURPLE 4');RGB = (/93,71,139/)
CASE ('MEDIUM SEA GREEN');RGB = (/60,179,113/)
CASE ('MEDIUM SLATE BLUE');RGB = (/123,104,238/)
CASE ('MEDIUM SPRING GREEN');RGB = (/0,250,154/)
CASE ('MEDIUM TURQUOISE');RGB = (/72,209,204/)
CASE ('MEDIUM VIOLET RED');RGB = (/199,21,133/)
CASE ('MELON');RGB = (/227,168,105/)
CASE ('MIDNIGHT BLUE');RGB = (/25,25,112/)
CASE ('MINT');RGB = (/189,252,201/)
CASE ('MINT CREAM');RGB = (/245,255,250/)
CASE ('MISTY ROSE');RGB = (/255,228,225/)
CASE ('MISTY ROSE 1');RGB = (/238,213,210/)
CASE ('MISTY ROSE 2');RGB = (/205,183,181/)
CASE ('MISTY ROSE 3');RGB = (/139,125,123/)
CASE ('MOCCASIN');RGB = (/255,228,181/)
CASE ('NAVAJO WHITE');RGB = (/255,222,173/)
CASE ('NAVAJO WHITE 1');RGB = (/238,207,161/)
CASE ('NAVAJO WHITE 2');RGB = (/205,179,139/)
CASE ('NAVAJO WHITE 3');RGB = (/139,121,94/)
CASE ('NAVY');RGB = (/0,0,128/)
CASE ('OLD LACE');RGB = (/253,245,230/)
CASE ('OLIVE');RGB = (/128,128,0/)
CASE ('OLIVE DRAB');RGB = (/192,255,62/)
CASE ('OLIVE DRAB 1');RGB = (/179,238,58/)
CASE ('OLIVE DRAB 2');RGB = (/154,205,50/)
CASE ('OLIVE DRAB 3');RGB = (/105,139,34/)
CASE ('ORANGE');RGB = (/255,128,0/)
CASE ('ORANGE 1');RGB = (/255,165,0/)
CASE ('ORANGE 2');RGB = (/238,154,0/)
CASE ('ORANGE 3');RGB = (/205,133,0/)
CASE ('ORANGE 4');RGB = (/139,90,0/)
CASE ('ORANGE RED');RGB = (/255,69,0/)
CASE ('ORANGE RED 1');RGB = (/238,64,0/)
CASE ('ORANGE RED 2');RGB = (/205,55,0/)
CASE ('ORANGE RED 3');RGB = (/139,37,0/)
CASE ('ORCHID');RGB = (/218,112,214/)
CASE ('ORCHID 1');RGB = (/255,131,250/)
CASE ('ORCHID 2');RGB = (/238,122,233/)
CASE ('ORCHID 3');RGB = (/205,105,201/)
CASE ('ORCHID 4');RGB = (/139,71,137/)
CASE ('PALE GOLDENROD');RGB = (/238,232,170/)
CASE ('PALE GREEN');RGB = (/152,251,152/)
CASE ('PALE GREEN 1');RGB = (/154,255,154/)
CASE ('PALE GREEN 2');RGB = (/144,238,144/)
CASE ('PALE GREEN 3');RGB = (/124,205,124/)
CASE ('PALE GREEN 4');RGB = (/84,139,84/)
CASE ('PALE TURQUOISE');RGB = (/187,255,255/)
CASE ('PALE TURQUOISE 1');RGB = (/174,238,238/)
CASE ('PALE TURQUOISE 2');RGB = (/150,205,205/)
CASE ('PALE TURQUOISE 3');RGB = (/102,139,139/)
CASE ('PALE VIOLET RED');RGB = (/219,112,147/)
CASE ('PALE VIOLET RED 1');RGB = (/255,130,171/)
CASE ('PALE VIOLET RED 2');RGB = (/238,121,159/)
CASE ('PALE VIOLET RED 3');RGB = (/205,104,137/)
CASE ('PALE VIOLET RED 4');RGB = (/139,71,93/)
CASE ('PAPAYA WHIP');RGB = (/255,239,213/)
CASE ('PEACH PUFF');RGB = (/255,218,185/)
CASE ('PEACH PUFF 1');RGB = (/238,203,173/)
CASE ('PEACH PUFF 2');RGB = (/205,175,149/)
CASE ('PEACH PUFF 3');RGB = (/139,119,101/)
CASE ('PEACOCK');RGB = (/51,161,201/)
CASE ('PINK');RGB = (/255,192,203/)
CASE ('PINK 1');RGB = (/255,181,197/)
CASE ('PINK 2');RGB = (/238,169,184/)
CASE ('PINK 3');RGB = (/205,145,158/)
CASE ('PINK 4');RGB = (/139,99,108/)
CASE ('PLUM');RGB = (/221,160,221/)
CASE ('PLUM 1');RGB = (/255,187,255/)
CASE ('PLUM 2');RGB = (/238,174,238/)
CASE ('PLUM 3');RGB = (/205,150,205/)
CASE ('PLUM 4');RGB = (/139,102,139/)
CASE ('POWDER BLUE');RGB = (/176,224,230/)
CASE ('PURPLE');RGB = (/128,0,128/)
CASE ('PURPLE 1');RGB = (/155,48,255/)
CASE ('PURPLE 2');RGB = (/145,44,238/)
CASE ('PURPLE 3');RGB = (/125,38,205/)
CASE ('PURPLE 4');RGB = (/85,26,139/)
CASE ('RASPBERRY');RGB = (/135,38,87/)
CASE ('RAW SIENNA');RGB = (/199,97,20/)
CASE ('RED');RGB = (/255,0,0/)
CASE ('RED 1');RGB = (/238,0,0/)
CASE ('RED 2');RGB = (/205,0,0/)
CASE ('RED 3');RGB = (/139,0,0/)
CASE ('ROSY BROWN');RGB = (/188,143,143/)
CASE ('ROSY BROWN 1');RGB = (/255,193,193/)
CASE ('ROSY BROWN 2');RGB = (/238,180,180/)
CASE ('ROSY BROWN 3');RGB = (/205,155,155/)
CASE ('ROSY BROWN 4');RGB = (/139,105,105/)
CASE ('ROYAL BLUE');RGB = (/65,105,225/)
CASE ('ROYAL BLUE 1');RGB = (/72,118,255/)
CASE ('ROYAL BLUE 2');RGB = (/67,110,238/)
CASE ('ROYAL BLUE 3');RGB = (/58,95,205/)
CASE ('ROYAL BLUE 4');RGB = (/39,64,139/)
CASE ('SALMON');RGB = (/250,128,114/)
CASE ('SALMON 1');RGB = (/255,140,105/)
CASE ('SALMON 2');RGB = (/238,130,98/)
CASE ('SALMON 3');RGB = (/205,112,84/)
CASE ('SALMON 4');RGB = (/139,76,57/)
CASE ('SANDY BROWN');RGB = (/244,164,96/)
CASE ('SAP GREEN');RGB = (/48,128,20/)
CASE ('SEA GREEN');RGB = (/84,255,159/)
CASE ('SEA GREEN 1');RGB = (/78,238,148/)
CASE ('SEA GREEN 2');RGB = (/67,205,128/)
CASE ('SEA GREEN 3');RGB = (/46,139,87/)
CASE ('SEASHELL');RGB = (/255,245,238/)
CASE ('SEASHELL 1');RGB = (/238,229,222/)
CASE ('SEASHELL 2');RGB = (/205,197,191/)
CASE ('SEASHELL 3');RGB = (/139,134,130/)
CASE ('SEPIA');RGB = (/94,38,18/)
CASE ('SIENNA');RGB = (/160,82,45/)
CASE ('SIENNA 1');RGB = (/255,130,71/)
CASE ('SIENNA 2');RGB = (/238,121,66/)
CASE ('SIENNA 3');RGB = (/205,104,57/)
CASE ('SIENNA 4');RGB = (/139,71,38/)
CASE ('SILVER');RGB = (/192,192,192/)
CASE ('SKY BLUE');RGB = (/135,206,235/)
CASE ('SKY BLUE 1');RGB = (/135,206,255/)
CASE ('SKY BLUE 2');RGB = (/126,192,238/)
CASE ('SKY BLUE 3');RGB = (/108,166,205/)
CASE ('SKY BLUE 4');RGB = (/74,112,139/)
CASE ('SLATE BLUE');RGB = (/106,90,205/)
CASE ('SLATE BLUE 1');RGB = (/131,111,255/)
CASE ('SLATE BLUE 2');RGB = (/122,103,238/)
CASE ('SLATE BLUE 3');RGB = (/105,89,205/)
CASE ('SLATE BLUE 4');RGB = (/71,60,139/)
CASE ('SLATE GRAY');RGB = (/112,128,144/)
CASE ('SLATE GRAY 1');RGB = (/198,226,255/)
CASE ('SLATE GRAY 2');RGB = (/185,211,238/)
CASE ('SLATE GRAY 3');RGB = (/159,182,205/)
CASE ('SLATE GRAY 4');RGB = (/108,123,139/)
CASE ('SNOW');RGB = (/255,250,250/)
CASE ('SNOW 1');RGB = (/238,233,233/)
CASE ('SNOW 2');RGB = (/205,201,201/)
CASE ('SNOW 3');RGB = (/139,137,137/)
CASE ('SPRING GREEN');RGB = (/0,255,127/)
CASE ('SPRING GREEN 1');RGB = (/0,238,118/)
CASE ('SPRING GREEN 2');RGB = (/0,205,102/)
CASE ('SPRING GREEN 3');RGB = (/0,139,69/)
CASE ('STEEL BLUE');RGB = (/70,130,180/)
CASE ('STEEL BLUE 1');RGB = (/99,184,255/)
CASE ('STEEL BLUE 2');RGB = (/92,172,238/)
CASE ('STEEL BLUE 3');RGB = (/79,148,205/)
CASE ('STEEL BLUE 4');RGB = (/54,100,139/)
CASE ('TAN');RGB = (/210,180,140/)
CASE ('TAN 1');RGB = (/255,165,79/)
CASE ('TAN 2');RGB = (/238,154,73/)
CASE ('TAN 3');RGB = (/205,133,63/)
CASE ('TAN 4');RGB = (/139,90,43/)
CASE ('TEAL');RGB = (/0,128,128/)
CASE ('THISTLE');RGB = (/216,191,216/)
CASE ('THISTLE 1');RGB = (/255,225,255/)
CASE ('THISTLE 2');RGB = (/238,210,238/)
CASE ('THISTLE 3');RGB = (/205,181,205/)
CASE ('THISTLE 4');RGB = (/139,123,139/)
CASE ('TOMATO');RGB = (/255,99,71/)
CASE ('TOMATO 1');RGB = (/238,92,66/)
CASE ('TOMATO 2');RGB = (/205,79,57/)
CASE ('TOMATO 3');RGB = (/139,54,38/)
CASE ('TURQUOISE');RGB = (/64,224,208/)
CASE ('TURQUOISE 1');RGB = (/0,245,255/)
CASE ('TURQUOISE 2');RGB = (/0,229,238/)
CASE ('TURQUOISE 3');RGB = (/0,197,205/)
CASE ('TURQUOISE 4');RGB = (/0,134,139/)
CASE ('TURQUOISE BLUE');RGB = (/0,199,140/)
CASE ('VIOLET');RGB = (/238,130,238/)
CASE ('VIOLET RED');RGB = (/208,32,144/)
CASE ('VIOLET RED 1');RGB = (/255,62,150/)
CASE ('VIOLET RED 2');RGB = (/238,58,140/)
CASE ('VIOLET RED 3');RGB = (/205,50,120/)
CASE ('VIOLET RED 4');RGB = (/139,34,82/)
CASE ('WARM GREY');RGB = (/128,128,105/)
CASE ('WHEAT');RGB = (/245,222,179/)
CASE ('WHEAT 1');RGB = (/255,231,186/)
CASE ('WHEAT 2');RGB = (/238,216,174/)
CASE ('WHEAT 3');RGB = (/205,186,150/)
CASE ('WHEAT 4');RGB = (/139,126,102/)
CASE ('WHITE');RGB = (/255,255,255/)
CASE ('WHITE SMOKE');RGB = (/245,245,245/)
CASE ('YELLOW');RGB = (/255,255,0/)
CASE ('YELLOW 1');RGB = (/238,238,0/)
CASE ('YELLOW 2');RGB = (/205,205,0/)
CASE ('YELLOW 3');RGB = (/139,139,0/)

CASE DEFAULT
   WRITE(MESSAGE,'(A,A,A)') "ERROR: The COLOR, ", TRIM(COLOR),", is not a defined color"
   CALL SHUTDOWN(MESSAGE)      
END SELECT

END SUBROUTINE COLOR2RGB


END MODULE OUTPUT_DATA


MODULE PROPERTY_DATA
USE PRECISION_PARAMETERS
IMPLICIT NONE

TYPE ELEMENT_TYPE
   CHARACTER(3):: ABBREVIATION
   CHARACTER(20):: NAME
   REAL :: MASS
END TYPE ELEMENT_TYPE

TYPE(ELEMENT_TYPE):: ELEMENT(118)

CONTAINS

SUBROUTINE JANAF_TABLE (I_TMP,CP,H,SPEC_ID,RCON,FUEL)
USE GLOBAL_CONSTANTS, ONLY: GAMMA,Y_O2_INFTY
!CP data in this subroutine is taken from 4th Edition of the NIST-JANAF Thermochemical Tables
!The tabulated data in the tables have been curve fit
!For gas species that result from liquid evaporation, H is set at the 0 K reference temperature to obtain the correct H_V
!at the H_V reference temperature for that liquid.
!For each species CP is first computed in kJ/mol/K and then converted to J/kg-K
CHARACTER(30),INTENT(IN) ::SPEC_ID
INTEGER,INTENT(IN) :: I_TMP
REAL(EB),INTENT(IN) :: RCON
REAL(EB),INTENT(OUT) :: CP,H
LOGICAL,INTENT(OUT) :: FUEL
REAL(EB) :: CP2,TE

TE = REAL(I_TMP,EB)
FUEL = .FALSE.
SELECT CASE (SPEC_ID)
   CASE DEFAULT
      CP = RCON*GAMMA/(GAMMA-1._EB) !J/kg/K
      H = 0._EB !J/kg     
   CASE('ACETYLENE')
      IF (TE < 100._EB) THEN
         CP = 1108.3994_EB+TE*0.0053834_EB
      ELSE
         CP = 351.2861_EB+892481.7_EB/TE**2-19564.62_EB/TE+0.1017971_EB*TE-0.0000344991_EB*TE**2+0.000000007268802_EB*TE**3-&
              0.0000000000008177768_EB*TE**4+3.76899E-17_EB*TE**5-48.94035_EB*LOG(TE) !kJ/mol/K
         CP = CP / 26.03728_EB * 1000._EB !J/kg/K
      ENDIF
      H = 652449.57190_EB !J/kg            
      FUEL = .TRUE.
   CASE('ACROLEIN')
      IF (TE<50._EB) THEN
         CP = 682.3929_EB + TE * 0.00066_EB !J/kg/K
      ELSE
         TE = MIN(TE,1500._EB)
         CP = 332.3828_EB-2602.398_EB/TE+0.6547594_EB*TE-0.0005857_EB*TE**2+0.0000002863821_EB*TE**3 &
              -0.00000000005696995_EB*TE**4-70.66684_EB*LOG(TE) !kJ/mol/K
         CP = CP / 56.06326_EB * 1000._EB !J/kg/K
      ENDIF
      H = 524068.20859_EB !J/kg
   CASE('AIR')
      IF (TE<100._EB) THEN
         CP = 1032.714_EB + TE * 0.064983_EB !J/kg/K
         CP2 = 904.8438_EB + TE * 0.060737_EB  !J/kg/K
      ELSE
         CP = 87.05047_EB-18075.59_EB/TE**2 - 669.4452/TE + 0.03857225_EB*TE - 0.00001590889_EB*TE**2 + 0.000000003770398_EB*TE**3 &
              - 0.000000000000459012_EB*TE**4 + 2.232133E-17_EB*TE**5 - 11.54189_EB*LOG(TE) !kJ/mol/K
         CP = CP / 28.0134_EB * 1000._EB !J/kg/K
         CP2 = 72.69494_EB - 566.7158_EB/TE + 0.03684584_EB*TE - 0.0000168704_EB*TE**2 + 0.000000004308058_EB*TE**3 &
              - 0.0000000000005561213_EB*TE**4 + 2.857776E-17_EB*TE**5 - 8.989582_EB*LOG(TE) !kJ/mol/K
         CP2 = CP2 / 31.9988_EB * 1000._EB !J/kg/K
      ENDIF
      H = (1._EB-Y_O2_INFTY)*147389.82301_EB+Y_O2_INFTY*190332.28442_EB !J/kg
      CP = (1._EB-Y_O2_INFTY)*CP+Y_O2_INFTY*CP2 !J/kg/K
   CASE('ARGON')
         CP = 20.786_EB / 0.040_EB !J/kg/K
         H = 120683.65150_EB !J/kg  
   CASE('BUTANE') !NIST webbook
      TE = MIN(1500._EB,MAX(50._EB,TE))
      CP = 8.86084E-10_EB*TE**4 - 2.73703E-06_EB*TE**3 + 1.22469E-03_EB*TE**2 + 4.07041E+00_EB*TE + 4.91048E+02_EB !J/kg/K
      H = 272771.23409_EB !J/kg      
      FUEL = .TRUE.                 
   CASE('CARBON DIOXIDE')
      IF (TE<100._EB) THEN
         CP = 658._EB + TE * 0.06981_EB !J/kg/K
      ELSE
         CP = -137.8814_EB + 3162.309_EB/TE - 0.01967907_EB*TE + 0.000002677873_EB*TE**2 - 0.0000000002017261_EB*TE**3 &
              + 6.084876E-15_EB*TE**4 + 29.8488_EB*LOG(TE) !kJ/mol/K
         CP = CP / 44.0095*1000_EB!J/kg/K
      ENDIF
      H = 438156.20234_EB !J/kg      
   CASE('CARBON MONOXIDE')
      IF (TE<100._EB) THEN
         CP = 1033.429_EB + TE * 0.090798_EB !J/kg/K
      ELSE
         CP = 43.9033_EB - 69.46386_EB/TE + 0.01806059_EB*TE - 0.000006173999_EB*TE**2 + 0.000000001003309_EB*TE**3 &
              - 6.3073984E-14_EB*TE**4 - 3.423053*LOG(TE) !kJ/mol/K
         CP = CP /  28.0101*1000_EB!J/kg/K
      ENDIF
      H = 303895.99177_EB !J/kg
   CASE('ETHANE') !NIST webbook
      TE = MIN(3000._EB,MAX(100._EB,TE))
      CP = 1.37631E-16_EB*TE**6 - 1.40898E-12_EB*TE**5 + 5.58268E-09_EB*TE**4 - 1.04586E-05_EB*TE**3 + 8.17688E-03_EB*TE**2 + &
           1.10227E+00_EB*TE + 9.73489E+02_EB !J/kg/K
      H = 462297.01999_EB !J/kg      
      FUEL = .TRUE.     
   CASE('ETHANOL')
      TE = MAX(TE,50._EB)
      CP = -445.7989_EB-335159.4_EB/TE**2+15246.42_EB/TE+0.0657487_EB*TE-0.00004985012_EB*TE**2+0.00000001383887_EB*TE**3-&
           0.000000000001815222_EB*TE**4+9.222421E-17_EB*TE**5+78.93689_EB*LOG(TE) !kJ/mol/K
      CP = CP / 46.06844_EB * 1000._EB !J/kg/K
      H = 940485.94520_EB !J/kg       
      FUEL = .TRUE.
   CASE('ETHYLENE')
      IF (TE<100._EB) THEN
         CP = 1187.5_EB + TE * 0.010002_EB !J/kg/K
      ELSE
         CP = -765.804_EB - 964594_EB/TE**2 + 30643.63_EB/TE - 0.07157813_EB*TE + 0.000007792221_EB*TE**2 &
              - 0.0000000003326001_EB*TE**3 - 2.706439E-14_EB*TE**4 + 2.510661E-18_EB*TE**5 + 129.46_EB*LOG(TE) !kJ/mol/K
         CP = CP / 28.05316_EB * 1000._EB !J/kg/K
      ENDIF
      H = 437233.30076_EB !J/kg      
      FUEL = .TRUE.
   CASE('FORMALDEHYDE')
      TE = MAX(TE,175._EB)
      CP = -1147.201_EB+169062500_EB/TE**3-5034450._EB/TE**2+68548.35_EB/TE-0.1448912_EB*TE+0.00002890129_EB*TE**2 -&
             0.000000004187057_EB*TE**3+0.0000000000003534827_EB*TE**4-1.289128E-17_EB*TE**5+183.1773_EB*LOG(TE)!J/mol/K
      CP = CP / 30.02598_EB * 1000._EB !J/kg/K
      H = 580062.72682_EB !J/kg            
   CASE('HYDROGEN')
      IF (TE<100._EB) THEN
         CP = 14685._EB - TE * 9.084204_EB !J/kg/K
      ELSE
         CP = 138.9978_EB - 2112.074_EB/TE + 0.06201484_EB*TE - 0.00002746675_EB*TE**2 + 0.00000000767361_EB*TE**3 &
              - 0.000000000001112505_EB*TE**4 + 6.209465E-17_EB*TE**5 -20.90222_EB*LOG(TE) !kJ/mol/K
         CP = CP /  2.01588*1000_EB!J/kg/K
      ENDIF
      H = 200059.42623_EB !J/kg
   CASE('HYDROGEN BROMIDE')
      IF (TE<100._EB) THEN
         CP = 350.925_EB + TE * 0.084659_EB !J/kg/K
      ELSE
         CP = 150.5185+83821.41_EB/TE**2-3380.966_EB/TE+0.05210022_EB*TE-0.00001942684_EB*TE**2+0.000000004370106_EB*TE**3&
              -0.0000000000005138871_EB*TE**4+2.433508E-17_EB*TE**5-21.93194_EB*LOG(TE) !kJ/mol/K
         CP = CP / 80.91194_EB * 1000._EB !J/kg/K
      ENDIF
      H = 211969.18928_EB !J/kg
   CASE('HYDROGEN CHLORIDE')
      IF (TE<100._EB) THEN
         CP = 785.111_EB + TE * 0.236287_EB !J/kg/K
      ELSE
         CP = 204.4656_EB+183314_EB/TE**2-5890.058_EB/TE+0.06083794_EB*TE-0.00002098845_EB*TE**2+0.000000004486574_EB*TE**3&
              -0.0000000000005086074_EB*TE**4+2.342705E-17_EB*TE**5-30.54396_EB*LOG(TE) !kJ/mol/K
         CP = CP / 36.46094_EB * 1000._EB !J/kg/K
      ENDIF
      H = 335953.95154_EB !J/kg
   CASE('HYDROGEN CYANIDE')
      IF (TE<100._EB) THEN
         CP = 1070.852_EB + TE * 0.156409_EB !J/kg/K
      ELSE
         CP = -57.025353_EB+1556.193_EB/TE+0.001382767_EB*TE-0.000001495245_EB*TE**2+0.0000000001314654_EB*TE**3&
               +1.758821E-14_EB*TE**4-2.419441E-18_EB*TE**5+15.34694_EB*LOG(TE) !kJ/mol/K
         CP = CP / 27.02534_EB * 1000._EB !J/kg/K
      ENDIF
      H = 672724.43873_EB !J/kg
   CASE('HYDROGEN FLUORIDE')
      IF (TE<100._EB) THEN
         CP = 1370.6_EB + TE * 0.858_EB !J/kg/K
      ELSEIF (TE>=100_EB .AND. TE<=200._EB) THEN
         CP = 1456.4_EB !J/kg/K
      ELSE
         CP = 204.4656_EB+183314_EB/TE**2-5890.058_EB/TE+0.06083794_EB*TE-0.00002098845_EB*TE**2+0.000000004486574_EB*TE**3&
              -0.0000000000005086074_EB*TE**4+2.342705E-17_EB*TE**5-30.54396_EB*LOG(TE) !kJ/mol/K
         CP = CP / 20.00634_EB * 1000._EB !J/kg/K
      ENDIF
      H = 187582.15786_EB !J/kg
   CASE('HELIUM')
         CP = 20.786_EB / 0.004_EB !J/kg/K
         H = -1498.49102_EB !J/kg
   CASE('ISOPROPANOL') !NIST webbook
      TE = MIN(3000._EB,MAX(50._EB,TE))
      CP = -7.06262E-11_EB*TE**4 + 7.07732E-07_EB*TE**3 - 2.72345E-03_EB*TE**2 + 4.97716E+00_EB*TE + 2.90147E+02_EB !J/kg/K
      H = 742735.23380_EB !J/kg      
      FUEL = .TRUE.        
   CASE('METHANE')
      IF (TE<100._EB) THEN
         CP = 2078.875_EB - TE * 0.0101122_EB !J/kg/K
      ELSE
         CP = -420.3769_EB - 993834.8_EB/TE**2 + 24488.36_EB/TE + 0.03226962_EB*TE - 0.00002813934_EB*TE**2 &
              + 0.000000007651289_EB*TE**3 - 0.0000000000009707785*TE**4+4.772684E-17_EB*TE**5 + 66.26671_EB*LOG(TE) !kJ/mol/K
         CP = CP / 16.04246_EB * 1000._EB !J/kg-K
      ENDIF
      H =349463.41316_EB  !J/kg     
      FUEL = .TRUE.
   CASE('METHANOL')
      TE = MAX(TE,200._EB)
      CP = -841.6793_EB-1508086_EB/TE**2+39536.25_EB/TE-0.07191862_EB*TE+0.000006024494_EB*TE**2+0.0000000002922874_EB*TE**3-&
           0.0000000000001171797_EB*TE**4+7.4231E-18_EB*TE**5+138.8215_EB*LOG(TE) !kJ/mol/K
      CP = CP / 32.04186_EB * 1000._EB !J/kg/K
      H = 1056190.26081_EB !J/kg   
      FUEL = .TRUE.
   CASE('N-HEPTANE')
      TE = MAX(TE,200._EB)
      CP = -3887.019_EB-2849358._EB/TE**2+130708.2_EB/TE-0.6320126_EB*TE+0.0001695335_EB*TE**2-0.00000003154411_EB*TE**3+&
           0.00000000000323268_EB*TE**4-1.374039E-16_EB*TE**5+670.4689_EB*LOG(TE) !kJ/mol/K
      CP = CP / 100.2019_EB * 1000._EB !J/kg/K
      H = 202610.22316_EB  !J/kg     
      FUEL = .TRUE.      
   CASE('N-HEXANE') !NIST webbook
      TE = MIN(1500._EB,MAX(200._EB,TE))
      CP = 5.49978E-07*TE**3 - 3.00549E-03*TE**2 + 6.19409E+00*TE + 1.14163E+02_EB !J/kg/K
      H = 212671.26959_EB !J/kg      
      FUEL = .TRUE.
   CASE('N-OCTANE') !NIST webbook
      TE = MIN(1500._EB,MAX(200._EB,TE))
      CP = 5.88541E-07*TE**3 - 3.17571E-03*TE**2 + 6.28923E+00*TE + 8.95150E+01_EB !J/kg/K
      H = 137208.90488_EB !J/kg      
      FUEL = .TRUE.
   CASE('NITRIC OXIDE')
      IF (TE<100._EB) THEN
         CP = 1002.6_EB + TE * 0.7391_EB !J/kg/K
      ELSE
         CP = -89.64446-273305.5/TE**2+6821.325/TE-0.00306611*TE-0.000002997734*TE**2+0.000000001149391*TE**3-&
               0.0000000000001697037*TE**4+9.16284E-18*TE**5+17.67416*LOG(TE) !kJ/mol/K
         CP = CP / 30.0061_EB * 1000._EB !J/kg/K
      ENDIF
      H = 358746.4066_EB !J/kg      
   CASE('NITROGEN')
      IF (TE<100._EB) THEN
         CP = 1032.714_EB + TE * 0.064983_EB !J/kg/K
      ELSE
         CP = 87.05047_EB-18075.59_EB/TE**2 - 669.4452/TE + 0.03857225_EB*TE - 0.00001590889_EB*TE**2 + 0.000000003770398_EB*TE**3 &
              - 0.000000000000459012_EB*TE**4 + 2.232133E-17_EB*TE**5 - 11.54189_EB*LOG(TE) !kJ/mol/K
         CP = CP / 28.0134 * 1000._EB !J/kg/K
      ENDIF
      H = 147389.82301_EB !J/kg     
   CASE('NITROGEN DIOXIDE')
      IF (TE<100._EB) THEN
         CP = 722.2609_EB + TE * 0.010559_EB !J/kg/K
      ELSE
         CP = -445.5618_EB-614794.8_EB/TE**2+18374.97_EB/TE-0.08599735_EB*TE+0.00002205842_EB*TE**2-0.0000000039020422_EB*TE**3&
              +0.0000000000003916969_EB*TE**4-1.644367E-17_EB*TE**5+79.24727_EB*LOG(TE) !kJ/mol/K
         CP = CP / 46.0055_EB * 1000._EB !J/kg/K
      ENDIF
      H = 323472.03341_EB !J/kg
   CASE('NITROUS OXIDE')
      IF (TE < 100._EB) THEN
         CP = 656.1590909_EB+TE*0.107857955_EB!J/kg/K
      ELSE
         CP = 135.4775_EB-37971.38_EB/TE**2+3432.027_EB/TE-0.01912358_EB*TE+0.000001548166_EB*TE**2+0.0000000002536593_EB*TE**3-&
              7.117205E-14_EB*TE**4+4.652381E-18_EB*TE**5+29.57471_EB*LOG(TE)!J/mol/K
         CP = CP / 44.0128_EB * 1000._EB !J/kg/K
      ENDIF
      H = 254813.7971_EB !J/kg         
   CASE('OXYGEN')
      IF (TE<100._EB) THEN
         CP = 904.8438_EB + TE * 0.060737_EB !J/kg/K
      ELSE
         CP = 72.69494_EB - 566.7158_EB/TE + 0.03684584_EB*TE - 0.0000168704_EB*TE**2 + 0.000000004308058_EB*TE**3 &
              - 0.0000000000005561213_EB*TE**4 + 2.857776E-17_EB*TE**5 - 8.989582_EB*LOG(TE) !kJ/mol/K
         CP = CP / 31.9988*1000_EB!J/kg-K
      ENDIF
      H = 190332.28442_EB !J/kg     
   CASE('PROPANE') !NIST webbook
      TE = MIN(1500._EB,MAX(100._EB,TE))
      CP = 1.67536E-09_EB*TE**4 - 5.46675E-06_EB*TE**3 + 4.38029E-03_EB*TE**2 + 2.79490E+00_EB*TE + 6.11728E+02_EB !J/kg/K   
      H = 472466.92234_EB !J/kg      
      FUEL = .TRUE.
   CASE('PROPYLENE') !NIST webbook
      TE = MIN(3000._EB,MAX(50._EB,TE))
      CP = 3.06959E-11*TE**4 + 3.20264E-08*TE**3 - 1.29745E-03*TE**2 + 4.14493E+00*TE + 5.03177E+02_EB !J/kg/K
      H = 510703.84568_EB !J/kg      
      FUEL = .TRUE.
   CASE('SOOT')
!      IF (.NOT.AL203) TEHEN
         IF (TE<100._EB) THEN
            CP = -39.5_EB + TE * 1.790405_EB !J/kg/K
         ELSE
            CP = -367.0215_EB-377212.2_EB/TE**2+12303.11_EB/TE-0.07902181_EB*TE+0.00002325095_EB*TE**2-0.000000004567174_EB*TE**3+ &
                 0.00000000000049475_EB*TE**4-2.218908E-17_EB*TE**5+63.20294*LOG(TE)!kJ/mol/K
            CP = CP / 12.0107_EB * 1000._EB !J/kg/K
         ENDIF
         H = 0._EB !J/kg
!      ELSE
!         IF (TE<100._EB) THEN
!            CP = -39.5_EB + TE * 0.0214849_EB
!         ELSE
!            CP = 138.9978_EB - 2112.074_EB/TE + 0.06201484_EB*TE - 0.00002746675_EB*TE**2 + 0.00000000767361_EB*TE**3 &
!               - 0.000000000001112505_EB*TE**4 + 6.209465E-17_EB*TE**5 -20.90222_EB*LOG(TE)
!            CP = CP / 102._EB
!         ENDIF
!         H = -89.6177E3_EB
!      ENDIF
   CASE('SULFUR DIOXIDE')
      IF (TE < 100._EB) THEN
         CP = 518.3438_EB+TE*0.055261_EB!J/kg/K
      ELSE
         CP = 388.9189_EB-445841.6_EB/TE**2+14473.77_EB/TE-0.0875575_EB*TE+0.0000251145_EB*TE**2-0.00000000487155_EB*TE**3+&
              0.0000000000005234599_EB*TE**4-2.334958E-17_EB*TE**5+71.83284_EB*LOG(TE) !J/mol/K
         CP = CP / 64.0638_EB * 1000._EB !J/kg/K
      ENDIF
      H = 335120.8188_EB !J/kg         
   CASE('SULFUR HEXAFLUORIDE')
      IF (TE < 100._EB) THEN
         CP = 203.96575_EB+TE*0.0895971_EB
      ELSE
         CP = -415.875_EB+1117223_EB/TE**2-11964.46_EB/TE-0.2148584_EB*TE+0.00008512579_EB*TE**2-0.00000002165436_EB*TE**3+&
              0.000000000002963585_EB*TE**4-1.655321E-16_EB*TE**5+104.9238_EB*LOG(TE) !kJ/mol/K
         CP = CP / 146.0554_EB * 1000._EB !J/kg/K
      ENDIF
      H = 102305.59191_EB !J/kg     CASE('TOLUENE')
      TE = MAX(TE,200._EB)
      CP = -1764.869_EB+730089.6_EB/TE**2+37622.14_EB/TE-0.223475_EB*TE+0.00003599891_EB*TE**2-0.00000000395711_EB*TE**3+&
            0.0000000000002350988_EB*TE**4-5.2885E-18_EB*TE**5+315.3972_EB*LOG(TE) !kJ/mol/K
      CP = CP / 92.13842_EB * 1000._EB !J/kg/K
      H = 353878.80556_EB !J/kg      
      FUEL = .TRUE.
   CASE('WATER VAPOR')
      IF (TE<100._EB) THEN
         CP = 1804.5_EB + TE * 0.452714_EB !J/kg/K
      ELSE
         CP = 102.2585_EB - 1084.688_EB/TE + 0.04410701_EB*TE - 0.00001181179_EB*TE**2 + 0.000000001601012_EB*TE**3 &
              - 8.408214E-14_EB*TE**4 - 13.55214_EB*LOG(TE) !kJ/mol/K
         CP = CP / 18.01528*1000_EB!J/kg/K
      ENDIF
      H = 1987495.09767_EB !J/kg
END SELECT       

END SUBROUTINE JANAF_TABLE

SUBROUTINE JANAF_TABLE_LIQUID (I_TMP,CP,H_V,H_L,T_REF,T_MELT,T_BOIL,SPEC_ID,FUEL,DENSITY)
!CP data in this subroutine is taken from 4th Edition of the NIST-JANAF Thermochemical Tables
!The tabulated data in the tables have been curve fit
!For each species CP is first computed in kJ/mol/K and then converted to J/kg/K
CHARACTER(30), INTENT(IN) ::SPEC_ID
INTEGER, INTENT(IN) :: I_TMP
REAL(EB), INTENT(INOUT) :: CP,H_V,H_L,T_REF,T_MELT,T_BOIL,DENSITY
REAL(EB) :: T
LOGICAL,INTENT(OUT) :: FUEL

FUEL = .FALSE.
SELECT CASE (SPEC_ID)
   !CASE('ACETYLENE') sublimation
   CASE('ACROLEIN')
      T = MIN(340._EB,MAX(290._EB,REAL(I_TMP,EB)))
      CP = 4.17143_EB*T+762._EB!J/kg/K
      H_L = -367034.69141_EB !J/kg
      H_V = 663470.8757_EB !J/kg
      T_REF = 186.15_EB !K
      T_MELT = 186.15_EB !K
      T_BOIL = 330._EB !K   
      DENSITY = 846._EB !kg/m^3      
   CASE('ARGON')
      CP = 1110._EB !J/kg/K
      H_L = -93018._EB !J/kg
      H_V = 164230.3215_EB !J/kg
      T_REF = 83.8_EB !K
      T_MELT = 83.8_EB !K
      T_BOIL = 87.29_EB !K  
      DENSITY = 1430._EB !kg/m^3   
   CASE('BUTANE')
      T = MIN(240._EB,MAX(100._EB,REAL(I_TMP,EB)))
      CP = 1.00177E-04_EB*T**3 - 5.23290E-02_EB*T**2 + 1.08908E+01_EB*T + 1.17542E+03_EB!J/kg/K
      H_L = -349795.71838_EB !J/kg      
      H_V = 440269.1313_EB !J/kg
      T_REF = 136._EB !K
      T_MELT = 136._EB !K
      T_BOIL = 272.66_EB !K   
      DENSITY = 600._EB !kg/m^3   
      FUEL = .TRUE.
   !CASE('CARBON DIOXIDE') sublimation
   CASE('CARBON MONOXIDE')
      T = MIN(85._EB,MAX(65._EB,REAL(I_TMP,EB)))
      CP = 2.94_EB*T+1.9319E3_EB !J/kg/K
      H_L = -144270.71250_EB !J/kg
      H_V = 374327.1563_EB !J/kg
      T_REF = 67.95_EB !K
      T_MELT = 67.95_EB !K
      T_BOIL = 81.63_EB !K 
      DENSITY = 788.6_EB !kg/m^3   
   CASE('ETHANE')
      T = MIN(240._EB,MAX(100._EB,REAL(I_TMP,EB)))
      CP = 1.08053E-04_EB*T**3 - 2.27232E-02_EB*T**2 + 1.55254E+00_EB*T + 2.24672E+03_EB !J/kg/K
      H_L = -228279.50000_EB !J/kg
      H_V = 577854.0716_EB !J/kg
      T_REF = 100._EB !K
      T_MELT = 100._EB !K
      T_BOIL = 184.32_EB !K      
      DENSITY = 546._EB !kg/m^3   
      FUEL = .TRUE.       
   CASE('ETHANOL')
      T = MIN(380._EB,MAX(159._EB,REAL(I_TMP,EB)))
      CP =   0.3229_EB*T+16.272_EB
      CP = CP / 46._EB * 1000._EB !J/kg/K
      H_L = -233412.18000_EB !J/kg
      H_V = 1082986.693_EB !J/kg
      T_REF = 158.8_EB !K
      T_MELT = 158.8_EB !K
      T_BOIL = 358.8_EB !K
      DENSITY = 790._EB !kg/m^3   
      FUEL = .TRUE.
   CASE('ETHYLENE')
      T = MIN(170._EB,MAX(110._EB,REAL(I_TMP,EB)))
      CP = -8.88178E-16_EB*T**3 + 2.28571E-02_EB*T**2 - 7.40000E+00_EB*T + 2.99329E+03_EB !J/kg/K
      H_L = -254918.36246_EB !J/kg
      H_V = 560569.8528_EB !J/kg
      T_REF = 103.8_EB !K
      T_MELT = 103.8_EB !K
      T_BOIL = 169.38_EB !K  
      DENSITY = 569._EB !kg/m^3   
      FUEL = .TRUE.
   CASE('FORMALDEHYDE')
      CP = 1180._EB !J/kg/K
      H_L = -213580._EB !J/kg      
      H_V = 776505.2933_EB !J/kg
      T_REF = 181._EB !K
      T_MELT = 181._EB !K
      T_BOIL = 254._EB !K      
      DENSITY = 812._EB !kg/m^3         
   CASE('HELIUM')
      T = MIN(4.22_EB,MAX(1.4_EB,REAL(I_TMP,EB)))
      CP = 5.62684E-01_EB*T**3 - 4.40229E+00_EB*T**2 + 1.17485E+01_EB*T - 8.45057E+00_EB!kJ/kg/K
      CP = CP*1000._EB !J/kg/K
      H_L = 0._EB !J/kg
      H_V = -1498.49102_EB !J/kg
      T_REF = 0._EB !K
      T_MELT = 0._EB !K
      T_BOIL = 4.22_EB !K  
      DENSITY = 125._EB !kg/m^3   
   CASE('HYDROGEN')
      T = MIN(21._EB,MAX(14._EB,REAL(I_TMP,EB)))
      CP = 445._EB*T+405._EB !J/kg/K
      H_L = -92980._EB !J/kg
      H_V = 404754.6321_EB !J/kg
      T_REF = 14._EB !K
      T_MELT = 14._EB !K
      T_BOIL = 20.28_EB !K    
      DENSITY = 71._EB !kg/m^3             
   CASE('HYDROGEN BROMIDE')
      T = MIN(205._EB,MAX(190._EB,REAL(I_TMP,EB)))
      CP = 0.52_EB*T+635.3!J/kg/K
      H_L = -136616.00773_EB !J/kg
      H_V = 278499.9834_EB !J/kg
      T_REF = 186.1_EB !K
      T_MELT = 186.1_EB !K
      T_BOIL = 206.35_EB !K  
      DENSITY = 2140._EB !kg/m^3         
   CASE('HYDROGEN CHLORIDE')
      T = MIN(185._EB,MAX(160._EB,REAL(I_TMP,EB)))
      CP = 0.925714_EB*T+1442.65!J/kg/K
      H_L = -256352.33235_EB !J/kg
      H_V = 464812.7099_EB !J/kg
      T_REF = 161.15_EB !K
      T_MELT = 161.15_EB !K
      T_BOIL = 188.05_EB !K  
      DENSITY = 1191._EB !kg/m^3         
   CASE('HYDROGEN CYANIDE')
      T = MIN(85._EB,MAX(70._EB,REAL(I_TMP,EB)))
      CP = 2.94_EB*T+1931.9_EB!J/kg/K
      H_L = -563850.25000_EB !J/kg
      H_V = 967993.1926_EB !J/kg
      T_REF = 260._EB !K
      T_MELT = 260._EB !K
      T_BOIL = 298.85_EB !K  
      DENSITY = 689._EB !kg/m^3   
   CASE('HYDROGEN FLUORIDE')
      T = MIN(290._EB,MAX(200._EB,REAL(I_TMP,EB)))
      CP = -6.21601E-06_EB*T**3 + 3.62354E-02_EB*T**2 - 1.23566E+01_EB*T + 3.22662E+03_EB!J/kg/K
      H_L = -409447.70480_EB !J/kg
      H_V = 460008.5869_EB !J/kg
      T_REF = 190._EB !K
      T_MELT = 190._EB !K
      T_BOIL = 292.5_EB !K  
      DENSITY = 991._EB !kg/m^3   
   CASE('ISOPROPANOL')
      T = MIN(430._EB,MAX(190._EB,REAL(I_TMP,EB)))
      CP = -2.34629E-04_EB*T**3 + 2.35666E-01_EB*T**2 - 6.55874E+01_EB*T + 7.42454E+03_EB!J/kg/K
      H_L = -344313.91347_EB !J/kg
      H_V = 882038.0541_EB !J/kg
      T_REF = 185._EB !K
      T_MELT = 185._EB !K
      T_BOIL = 370.57_EB !K      
      DENSITY = 785._EB !kg/m^3   
      FUEL = .TRUE.
   CASE('METHANE')
      T = MIN(140._EB,MAX(100._EB,REAL(I_TMP,EB)))
      CP = 2.33333E-03_EB*T**3 - 6.75000E-01_EB*T**2 + 7.17167E+01_EB*T + 6.17400E+02_EB !J/kg/K
      H_L = -305539.44_EB !J/kg
      H_V = 537767.9796_EB !J/kg
      T_REF = 90.6_EB !K
      T_MELT = 90.6_EB !K
      T_BOIL = 111.63_EB !K 
      DENSITY = 422._EB !kg/m^3         
   CASE('METHANOL')
      T = MIN(460._EB,MAX(177._EB,REAL(I_TMP,EB)))
      CP =   0.0008750616_EB*T**2 - 0.3274918_EB*T + 101.2359_EB !kJ/mol/K
      CP = CP / 32._EB * 1000._EB !J/kg/K
      H_L = -389096.94379_EB !J/kg
      H_V = 1274613.912_EB !J/kg
      T_REF = 176.6_EB !K
      T_MELT = 176.6_EB !K
      T_BOIL = 337.7_EB !K
      DENSITY = 792._EB !kg/m^3   
      FUEL = .TRUE.
   CASE('N-HEPTANE')
      T = MIN(480._EB,MAX(183._EB,REAL(I_TMP,EB)))
      CP =  0.001061074_EB*T**2 - 0.267961_EB*T + 209.8049_EB !kJ/mol/K
      CP = CP / 100._EB * 1000._EB !J/kg/K
      H_L = -358349.92931_EB !J/kg
      H_V = 435866.5197_EB !J/kg
      T_REF = 182.55_EB !K
      T_MELT = 182.55_EB !K
      T_BOIL = 371.53_EB !K
      DENSITY = 684._EB !kg/m^3         
      FUEL = .TRUE.
   CASE('N-HEXANE')
      T = MIN(420._EB,MAX(180._EB,REAL(I_TMP,EB)))
      CP = -1.75895E-05_EB*T**3 + 2.79792E-02_EB*T**2 - 7.78253E+00_EB*T + 2.57041E+03_EB!J/kg/K
      H_L = -351480.12132_EB !J/kg      
      H_V = 433009.6801_EB !J/kg
      T_REF = 178.1_EB !K
      T_MELT = 178.1_EB !K
      T_BOIL = 342.44_EB !K      
      DENSITY = 659._EB !kg/m^3   
      FUEL = .TRUE.
   CASE('N-OCTANE')
      T = MIN(460._EB,MAX(220._EB,REAL(I_TMP,EB)))
      CP = -1.87195E-05_EB*T**3 + 2.64395E-02_EB*T**2 - 7.24933E+00_EB*T + 2.53812E+03_EB!J/kg/K
      H_L = -437707.70041_EB !J/kg      
      H_V = 402857.828_EB !J/kg
      T_REF = 216.3_EB !K
      T_MELT = 216.3_EB !K
      T_BOIL = 398.44_EB !K    
      DENSITY = 703._EB !kg/m^3           
      FUEL = .TRUE.
   CASE('NITROGEN')
      T = MIN(90._EB,MAX(65._EB,REAL(I_TMP,EB)))
      CP = 1.72593E-02_EB*T**3 - 3.93206E+00_EB*T**2 + 3.01689E+02_EB*T - 5.75359E+03_EB !J/kg/K
      H_L = -125528.75907_EB !J/kg
      H_V = 212890.8484_EB !J/kg
      T_REF = 63.3_EB !K
      T_MELT = 63.3_EB !K
      T_BOIL = 77.35_EB !K
      DENSITY = 807._EB !kg/m^3         
   CASE('NITRIC OXIDE')
      T = MIN(122._EB,MAX(110._EB,REAL(I_TMP,EB)))
      CP =  54.38_EB*T - 3926.9_EB!J/kg/K
      H_L = -665258.19847!J/kg
      H_V = 460000._EB !J/kg
      T_REF = 110._EB !K
      T_MELT = 110._EB !K
      T_BOIL = 122._EB !K        
      DENSITY = 1270._EB !kg/m^3   
   CASE('NITROGEN DIOXIDE')
      T = MIN(340._EB,MAX(290._EB,REAL(I_TMP,EB)))
      CP = 3.16667E-02_EB*T**2 - 1.12464E+01_EB*T + 3.13744E+03_EB!J/kg/K
      H_L = -228121.09!J/kg
      H_V = 517409.8052_EB !J/kg
      T_REF = 262._EB !K
      T_MELT = 262._EB !K
      T_BOIL = 294.15_EB !K        
      DENSITY = 1448._EB !kg/m^3   
   CASE('NITROUS OXIDE')
      T = MIN(184.67_EB,MAX(182.29_EB,REAL(I_TMP,EB)))
      CP = 187.7_EB+8.5_EB*T !J/kg/K
      H_L = -316668.6829_EB !J/kg      
      H_V = 376140._EB !J/kg
      T_REF = 182.29_EB !K
      T_MELT = 182.29_EB !K
      T_BOIL = 184.67_EB !K                       
      DENSITY = 1266._EB !kg/m^3   
   CASE('OXYGEN')
      T = MIN(100._EB,MAX(60._EB,REAL(I_TMP,EB)))
      CP = 8.33333E-04_EB*T**3 - 1.42143E-01_EB*T**2 + 8.10952E+00_EB*T + 1.50911E+03_EB!J/kg/K
      H_L = -91185.35477_EB !J/kg
      H_V = 240008.9577_EB !J/kg
      T_REF = 54.8_EB !K
      T_MELT = 54.8_EB !K
      T_BOIL = 90.19_EB !K 
      DENSITY = 1140._EB !kg/m^3   
   CASE('PROPANE')
      T = MIN(270._EB,MAX(90._EB,REAL(I_TMP,EB)))
      CP = 7.05233E-05_EB*T**3 - 2.26153E-02_EB*T**2 + 3.85475E+00_EB*T + 1.69008E+03_EB!J/kg/K
      H_L = -163850.21479_EB !J/kg
      H_V = 552422.9873 !J/kg
      T_REF = 86._EB !K
      T_MELT = 86._EB !K
      T_BOIL = 231.25_EB !K      
      DENSITY = 590._EB !kg/m^3   
      FUEL = .TRUE.
   CASE('PROPYLENE')
      T = MIN(280._EB,MAX(90._EB,REAL(I_TMP,EB)))
      CP = -6.71250E-05_EB*T**3 + 5.75614E-02_EB*T**2 - 1.29825E+01_EB*T + 2.94746E+03_EB !J/kg/K
      H_L = -193278.64292_EB !J/kg      
      H_V = 575811.5686_EB !J/kg
      T_REF = 88._EB !K
      T_MELT = 88._EB !K
      T_BOIL = 225.41_EB !K      
      DENSITY = 609._EB !kg/m^3   
      FUEL = .TRUE.
   CASE('SULFUR DIOXIDE')
      CP = 1359.14286_EB !J/kg/K
      H_L = -267955.0148_EB !J/kg      
      H_V = 389370._EB !J/kg
      T_REF = 197.15_EB !K
      T_MELT = 197.15_EB !K
      T_BOIL = 263.05_EB !K       
      DENSITY = 1434._EB !kg/m^3         
   !CASE('SULFUR HEXAFLUORIDE') sublimation
   CASE('TOLUENE')
      T = MIN(430._EB,MAX(178._EB,REAL(I_TMP,EB)))
      CP = 0.0007691129_EB*T**2- 0.1856684_EB*T + 143.1817_EB !kJ/mol/K
      CP = CP / 92._EB * 1000._EB !J/kg/K
      H_L = -260377.01745_EB !J/kg
      H_V = 487999.8681_EB !J/kg
      T_REF = 178.1_EB !K
      T_MELT = 178.1_EB !K
      T_BOIL = 383.8_EB !K      
      DENSITY = 867._EB !kg/m^3   
      FUEL = .TRUE.
   CASE('WATER VAPOR')
      T = MIN(500._EB,MAX(273._EB,REAL(I_TMP,EB)))
      CP = 194.74308_EB - 1.2338708_EB*T + 0.0047935684_EB*T**2 - 0.0000084183512_EB*T**3 + 0.0000000057563403_EB*T**4 !kJ/mol/K
      CP = CP /  18._EB*1000_EB !J/kg/K
      H_L = -1150975.11714_EB
      H_V = 2492163.102_EB !J/kg
      T_REF = 273.15_EB !K
      T_MELT = 273.15_EB !K
      T_BOIL = 373.15_EB !K
      DENSITY = 1000._EB !kg/m^3   
   CASE DEFAULT
      CP = -1._EB
      H_L = -1._EB
      H_V = -1._EB
      T_REF = -1._EB
      DENSITY=-1._EB
END SELECT    

END SUBROUTINE JANAF_TABLE_LIQUID


SUBROUTINE GAS_PROPS(GAS_NAME,SIGMA,EPSOK,MW,ABSORBING,FORMULA,LISTED,ATOM_COUNTS)

! Molecular weight (g/mol) and Lennard-Jones properties
! Brodkey, R. and Hershey, H. Transport Phenomena: A Unified Approach. McGraw-Hill. 1988

USE GLOBAL_CONSTANTS, ONLY: MW_AIR 
REAL(EB) :: SIGMA,EPSOK,MW,SIGMAIN,EPSOKIN,MWIN,ATOM_COUNTS(118)
CHARACTER(30) :: GAS_NAME
CHARACTER(100) :: FORMULA,FORMULAIN
LOGICAL :: ABSORBING
LOGICAL, INTENT(OUT) :: LISTED
 
SIGMAIN = SIGMA
EPSOKIN = EPSOK
FORMULAIN = FORMULA
FORMULA = 'null'
MWIN    = MW
MW = -1._EB
LISTED  = .TRUE.
ATOM_COUNTS = 0._EB

SELECT CASE(GAS_NAME)
   CASE('ACETYLENE')
      SIGMA=4.033_EB
      EPSOK=231.8_EB 
      FORMULA='C2H2'  
      ABSORBING = .TRUE.        
   CASE('ACROLEIN') !Isopropanol as surrogate             
      SIGMA=4.549_EB
      EPSOK=576.7_EB 
      FORMULA='C3H4O'
      ABSORBING = .TRUE.        
   CASE('AIR')             
      SIGMA=3.711_EB 
      EPSOK= 78.6_EB  
      MW=MW_AIR
      FORMULA='Air'
   CASE('ARGON')
      SIGMA=3.42_EB
      EPSOK= 124.0_EB
      FORMULA='Ar'
   CASE('BUTANE')
      SIGMA=4.687_EB
      EPSOK=531.4_EB 
      ABSORBING = .TRUE.
      FORMULA='C4H10'
   CASE('CARBON DIOXIDE')  
      SIGMA=3.941_EB 
      EPSOK=195.2_EB  
      ABSORBING = .TRUE.      
      FORMULA='CO2'
   CASE('CARBON MONOXIDE') 
      SIGMA=3.690_EB 
      EPSOK= 91.7_EB  
      ABSORBING = .TRUE.
      FORMULA='CO'
   CASE('ETHANE')
      SIGMA=4.443_EB
      EPSOK=215.7_EB 
      FORMULA='C2H6'  
      ABSORBING = .TRUE.     
   CASE('ETHANOL')
      SIGMA=4.530_EB
      EPSOK=362.6_EB
      FORMULA='C2H5OH'  
   CASE('ETHYLENE')        
      SIGMA=4.163_EB 
      EPSOK=224.7_EB 
      ABSORBING = .TRUE.
      FORMULA='C2H4'
   CASE('FORMALDEHYDE')!Methanol as surrogate        
      SIGMA=3.626_EB 
      EPSOK=481.8_EB 
      FORMULA='CH2O'
   CASE('HELIUM')          
      SIGMA=2.551_EB 
      EPSOK= 10.22_EB 
      FORMULA='He2'
   CASE('HYDROGEN')        
      SIGMA=2.827_EB 
      EPSOK= 59.7_EB
      FORMULA='H2'
   CASE('HYDROGEN BROMIDE')   
      SIGMA=3.353_EB
      EPSOK=449._EB
      FORMULA='HBr'  
   CASE('HYDROGEN CHLORIDE')   
      SIGMA=3.339_EB
      EPSOK=344.7_EB
      FORMULA='HCl'  
   CASE('HYDROGEN CYANIDE')   
      SIGMA=3.63_EB
      EPSOK=569.1_EB
      FORMULA='HCN'  
    CASE('HYDROGEN FLUORIDE')   
      SIGMA=3.148_EB
      EPSOK=330._EB
      FORMULA='HF'  
   CASE('ISOPROPANOL')
      SIGMA=4.549_EB
      EPSOK=576.7_EB 
      FORMULA='C3H7OH'  
      ABSORBING = .TRUE.
   CASE('METHANE')         
      SIGMA=3.758_EB 
      EPSOK=148.6_EB  
      ABSORBING = .TRUE.
      FORMULA='CH4'
   CASE('METHANOL')
      SIGMA=3.626_EB
      EPSOK=481.8_EB
      FORMULA='CH3OH'  
   CASE('N-DECANE')
      SIGMA=5.233_EB
      EPSOK=226.46_EB
      FORMULA='C10H22'  
   CASE('N-HEPTANE')
      SIGMA=4.701_EB
      EPSOK=205.78_EB
      FORMULA='C7H16'
   CASE('N-HEXANE')
      SIGMA=5.949_EB
      EPSOK=399.3_EB 
      FORMULA='C6H14'  
      ABSORBING = .TRUE.          
   CASE('N-OCTANE')
      SIGMA=4.892_EB
      EPSOK=231.16_EB
      FORMULA='C8H18'
   CASE('NITRIC OXIDE')        
      SIGMA=3.492_EB 
      EPSOK= 116.7_EB  
      FORMULA='NO'
   CASE('NITROGEN')        
      SIGMA=3.798_EB 
      EPSOK= 71.4_EB  
      FORMULA='N2'
   CASE('NITROGEN DIOXIDE') !Paul, P. DRFM, SAND98-8203
      SIGMA=3.922_EB 
      EPSOK= 204.88_EB  
      FORMULA='NO2'      
   CASE('NITROUS OXIDE')
      SIGMA=3.828_EB 
      EPSOK= 232.4_EB  
      FORMULA='N2O'      
   CASE('OXYGEN')          
      SIGMA=3.467_EB 
      EPSOK=106.7_EB  
      FORMULA='O2'
   CASE('PROPANE')
      SIGMA=5.118_EB
      EPSOK=237.1_EB
      FORMULA='C3H8'  
      ABSORBING = .TRUE.
   CASE('PROPYLENE')
      SIGMA=4.678_EB
      EPSOK=298.9_EB 
      FORMULA='C3H6'  
      ABSORBING = .TRUE.  
   CASE('SOOT')        
      SIGMA=3.798_EB 
      EPSOK= 71.4_EB  
      MW=ELEMENT(12)%MASS
      FORMULA='Soot'
   CASE('SULFUR DIOXIDE')
      SIGMA=4.112_EB
      EPSOK=335.4_EB 
      FORMULA='SO2'             
   CASE('SULFUR HEXAFLUORIDE')
      SIGMA=5.128_EB
      EPSOK=222.1_EB 
      FORMULA='SF6'       
   CASE('TOLUENE')   
      SIGMA=5.698_EB
      EPSOK=480._EB !Estimated from BENZENE
      FORMULA='C6H5CH3'  
   CASE('WATER VAPOR')     
      SIGMA=2.641_EB 
      EPSOK=809.1_EB  
      ABSORBING = .TRUE.
      FORMULA='H2O'
   CASE DEFAULT            
      SIGMA=3.711_EB 
      EPSOK= 78.6_EB
      MW=MW_AIR 
      LISTED = .FALSE.
END SELECT
IF (SIGMAIN>0._EB) SIGMA = SIGMAIN
IF (EPSOKIN>0._EB) EPSOK = EPSOKIN
IF (TRIM(FORMULAIN)/='null') FORMULA = FORMULAIN
IF (TRIM(FORMULA)/='null' .AND. TRIM(FORMULA)/='Air' .AND. TRIM(FORMULA)/= 'Soot') CALL GET_FORMULA_WEIGHT(FORMULA,MW,ATOM_COUNTS) 
IF (MWIN   >0._EB) MW    = MWIN

END SUBROUTINE GAS_PROPS


SUBROUTINE FED_PROPS(GAS_NAME,FLD_IRR,FIC_IRR)
! Lethal and incapacitating concentrations
! D.A. Purser, SFPE Handbook, 4th Ed.

REAL(EB),INTENT(INOUT):: FLD_IRR,FIC_IRR
REAL(EB) ::FLD_IRR_IN,FIC_IRR_IN
CHARACTER(30) GAS_NAME
  
FLD_IRR_IN = FLD_IRR
FIC_IRR_IN = FIC_IRR

SELECT CASE(GAS_NAME)
   CASE('HYDROGEN BROMIDE')   
      FLD_IRR=0.114000_EB
      FIC_IRR=0.000900_EB
   CASE('HYDROGEN CHLORIDE')
      FLD_IRR=0.114000_EB
      FIC_IRR=0.000900_EB
   CASE('HYDROGEN FLUORIDE')
      FLD_IRR=0.087000_EB
      FIC_IRR=0.000900_EB
   CASE('SULFUR DIOXIDE')
      FLD_IRR=0.012000_EB
      FIC_IRR=0.000120_EB
   CASE('NITROGEN DIOXIDE')
      FLD_IRR=0.001900_EB
      FIC_IRR=0.000350_EB
   CASE('ACROLEIN')
      FLD_IRR=0.004500_EB
      FIC_IRR=0.000020_EB
   CASE('FORMALDEHYDE')
      FLD_IRR=0.022500_EB
      FIC_IRR=0.000030_EB
   CASE DEFAULT
      FLD_IRR=0._EB
      FIC_IRR=0._EB
END SELECT
 
IF(FLD_IRR_IN > 0._EB) FLD_IRR = FLD_IRR_IN
IF(FIC_IRR_IN > 0._EB) FIC_IRR = FIC_IRR_IN
 
END SUBROUTINE FED_PROPS


SUBROUTINE CALC_GAS_PROPS(J,N,D_TMP,MU_TMP,K_TMP,CP_TMP,H_TMP,FUEL)
USE TYPES, ONLY:SPECIES_TYPE,SPECIES,SPECIES_MIXTURE_TYPE,SPECIES_MIXTURE
USE GLOBAL_CONSTANTS, ONLY: TMPA,PR
INTEGER,INTENT(IN) :: J,N
INTEGER :: I(1)
REAL(EB), INTENT(OUT) :: D_TMP,MU_TMP,K_TMP,CP_TMP,H_TMP
REAL(EB) :: SIGMA2,EPSIJ,AMW,TSTAR,OMEGA,TMP
LOGICAL, INTENT(INOUT) :: FUEL
TYPE(SPECIES_TYPE),POINTER :: SS=>NULL(),SS0=>NULL()

SS=>SPECIES(N)
I = MAXLOC(SPECIES_MIXTURE(0)%VOLUME_FRACTION)
SS0=>SPECIES(I(1))

TMP = REAL(J,EB)
SIGMA2 = (0.5_EB*(SS%SIG+SS0%SIG))**2
EPSIJ  = SQRT(SS%EPSK*SS0%EPSK)
AMW    = SQRT( (SS%MW+SS0%MW)/(2._EB*SS%MW*SS0%MW) )
TSTAR = TMP/EPSIJ
OMEGA = 1.06036_EB*TSTAR**(-0.15610_EB) + 0.19300_EB*EXP(-0.47635_EB*TSTAR) + 1.03587_EB*EXP(-1.52996_EB*TSTAR) &
      + 1.76474_EB*EXP(-3.89411_EB*TSTAR)  
D_TMP = 0.00266E-4_EB*AMW*TMP**1.5_EB/(SIGMA2*OMEGA)
IF (SS%D_USER>=0._EB) D_TMP = SS%D_USER
SIGMA2 = SS%SIG**2
TSTAR = TMP/SS%EPSK
OMEGA = 1.16145_EB*TSTAR**(-0.14874_EB) +  0.52487_EB*EXP(-0.77320_EB*TSTAR) + 2.16178_EB*EXP(-2.43787_EB*TSTAR)
MU_TMP = 26.69E-7_EB*(SS%MW*TMP)**0.5_EB/(SIGMA2*OMEGA)/SS%MW
IF (SS%MU_USER>=0._EB) MU_TMP = SS%MU_USER/SS%MW
CALL JANAF_TABLE(J,CP_TMP,H_TMP,SS%ID,SS%RCON,FUEL)
IF (SS%SPECIFIC_HEAT > 0._EB) CP_TMP = SS%SPECIFIC_HEAT
IF (SS%REFERENCE_ENTHALPY > 0._EB) H_TMP = SS%REFERENCE_ENTHALPY - SS%SPECIFIC_HEAT * SS%REFERENCE_TEMPERATURE
K_TMP = MU_TMP*CP_TMP/PR
IF (SS%K_USER>=0._EB) K_TMP = SS%K_USER/SS%MW

END SUBROUTINE CALC_GAS_PROPS

SUBROUTINE MAKE_PERIODIC_TABLE

ELEMENT(1)%ABBREVIATION='H'; ELEMENT(1)%NAME='HYDROGEN'; ELEMENT(1)%MASS=1.00794_EB
ELEMENT(2)%ABBREVIATION='He'; ELEMENT(2)%NAME='HELIUM'; ELEMENT(2)%MASS=4.002602_EB
ELEMENT(3)%ABBREVIATION='Li'; ELEMENT(3)%NAME='LITHIUM'; ELEMENT(3)%MASS=6.941_EB
ELEMENT(4)%ABBREVIATION='Be'; ELEMENT(4)%NAME='BERYLLIUM'; ELEMENT(4)%MASS=9.012182_EB
ELEMENT(5)%ABBREVIATION='B'; ELEMENT(5)%NAME='BORON'; ELEMENT(5)%MASS=10.811_EB
ELEMENT(6)%ABBREVIATION='C'; ELEMENT(6)%NAME='CARBON'; ELEMENT(6)%MASS=12.0107_EB
ELEMENT(7)%ABBREVIATION='N'; ELEMENT(7)%NAME='NITROGEN'; ELEMENT(7)%MASS=14.0067_EB
ELEMENT(8)%ABBREVIATION='O'; ELEMENT(8)%NAME='OXYGEN'; ELEMENT(8)%MASS=15.9994_EB
ELEMENT(9)%ABBREVIATION='F'; ELEMENT(9)%NAME='FLUORINE'; ELEMENT(9)%MASS=18.9984032_EB
ELEMENT(10)%ABBREVIATION='Ne'; ELEMENT(10)%NAME='NEON'; ELEMENT(10)%MASS=20.1797_EB
ELEMENT(11)%ABBREVIATION='Na'; ELEMENT(11)%NAME='SODIUM'; ELEMENT(11)%MASS=22.98976928_EB
ELEMENT(12)%ABBREVIATION='Mg'; ELEMENT(12)%NAME='MAGNESIUM'; ELEMENT(12)%MASS=24.305_EB
ELEMENT(13)%ABBREVIATION='Al'; ELEMENT(13)%NAME='ALUMINIUM'; ELEMENT(13)%MASS=26.9815386_EB
ELEMENT(14)%ABBREVIATION='Si'; ELEMENT(14)%NAME='SILICON'; ELEMENT(14)%MASS=28.0855_EB
ELEMENT(15)%ABBREVIATION='P'; ELEMENT(15)%NAME='PHOSPHORUS'; ELEMENT(15)%MASS=30.973762_EB
ELEMENT(16)%ABBREVIATION='S'; ELEMENT(16)%NAME='SULFUR'; ELEMENT(16)%MASS=32.065_EB
ELEMENT(17)%ABBREVIATION='Cl'; ELEMENT(17)%NAME='CHLORINE'; ELEMENT(17)%MASS=35.453_EB
ELEMENT(18)%ABBREVIATION='Ar'; ELEMENT(18)%NAME='ARGON'; ELEMENT(18)%MASS=39.948_EB
ELEMENT(19)%ABBREVIATION='K'; ELEMENT(19)%NAME='POTASSIUM'; ELEMENT(19)%MASS=39.0983_EB
ELEMENT(20)%ABBREVIATION='Ca'; ELEMENT(20)%NAME='CALCIUM'; ELEMENT(20)%MASS=40.078_EB
ELEMENT(21)%ABBREVIATION='Sc'; ELEMENT(21)%NAME='SCANDIUM'; ELEMENT(21)%MASS=44.955912_EB
ELEMENT(22)%ABBREVIATION='Ti'; ELEMENT(22)%NAME='TITANIUM'; ELEMENT(22)%MASS=47.867_EB
ELEMENT(23)%ABBREVIATION='V'; ELEMENT(23)%NAME='VANADIUM'; ELEMENT(23)%MASS=50.9415_EB
ELEMENT(24)%ABBREVIATION='Cr'; ELEMENT(24)%NAME='CHROMIUM'; ELEMENT(24)%MASS=51.9961_EB
ELEMENT(25)%ABBREVIATION='Mn'; ELEMENT(25)%NAME='MANGANESE'; ELEMENT(25)%MASS=54.938045_EB
ELEMENT(26)%ABBREVIATION='Fe'; ELEMENT(26)%NAME='IRON'; ELEMENT(26)%MASS=55.845_EB
ELEMENT(27)%ABBREVIATION='Co'; ELEMENT(27)%NAME='COBALT'; ELEMENT(27)%MASS=58.933195_EB
ELEMENT(28)%ABBREVIATION='Ni'; ELEMENT(28)%NAME='NICKEL'; ELEMENT(28)%MASS=58.6934_EB
ELEMENT(29)%ABBREVIATION='Cu'; ELEMENT(29)%NAME='COPPER'; ELEMENT(29)%MASS=63.546_EB
ELEMENT(30)%ABBREVIATION='Zn'; ELEMENT(30)%NAME='ZINC'; ELEMENT(30)%MASS=65.38_EB
ELEMENT(31)%ABBREVIATION='Ga'; ELEMENT(31)%NAME='GALLIUM'; ELEMENT(31)%MASS=69.723_EB
ELEMENT(32)%ABBREVIATION='Ge'; ELEMENT(32)%NAME='GERMANIUM'; ELEMENT(32)%MASS=72.64_EB
ELEMENT(33)%ABBREVIATION='As'; ELEMENT(33)%NAME='ARSENIC'; ELEMENT(33)%MASS=74.9216_EB
ELEMENT(34)%ABBREVIATION='Se'; ELEMENT(34)%NAME='SELENIUM'; ELEMENT(34)%MASS=78.96_EB
ELEMENT(35)%ABBREVIATION='Br'; ELEMENT(35)%NAME='BROMINE'; ELEMENT(35)%MASS=79.904_EB
ELEMENT(36)%ABBREVIATION='Kr'; ELEMENT(36)%NAME='KRYPTON'; ELEMENT(36)%MASS=83.798_EB
ELEMENT(37)%ABBREVIATION='Rb'; ELEMENT(37)%NAME='RUBIDIUM'; ELEMENT(37)%MASS=85.4678_EB
ELEMENT(38)%ABBREVIATION='Sr'; ELEMENT(38)%NAME='STRONTIUM'; ELEMENT(38)%MASS=87.62_EB
ELEMENT(39)%ABBREVIATION='Y'; ELEMENT(39)%NAME='YTTRIUM'; ELEMENT(39)%MASS=88.90585_EB
ELEMENT(40)%ABBREVIATION='Zr'; ELEMENT(40)%NAME='ZIRCONIUM'; ELEMENT(40)%MASS=91.224_EB
ELEMENT(41)%ABBREVIATION='Nb'; ELEMENT(41)%NAME='NIOBIUM'; ELEMENT(41)%MASS=92.90638_EB
ELEMENT(42)%ABBREVIATION='Mo'; ELEMENT(42)%NAME='MOLYBDENUM'; ELEMENT(42)%MASS=95.96_EB
ELEMENT(43)%ABBREVIATION='Tc'; ELEMENT(43)%NAME='TECHNETIUM'; ELEMENT(43)%MASS=98_EB
ELEMENT(44)%ABBREVIATION='Ru'; ELEMENT(44)%NAME='RUTHENIUM'; ELEMENT(44)%MASS=101.07_EB
ELEMENT(45)%ABBREVIATION='Rh'; ELEMENT(45)%NAME='RHODIUM'; ELEMENT(45)%MASS=102.9055_EB
ELEMENT(46)%ABBREVIATION='Pd'; ELEMENT(46)%NAME='PALLADIUM'; ELEMENT(46)%MASS=106.42_EB
ELEMENT(47)%ABBREVIATION='Ag'; ELEMENT(47)%NAME='SILVER'; ELEMENT(47)%MASS=107.8682_EB
ELEMENT(48)%ABBREVIATION='Cd'; ELEMENT(48)%NAME='CADMIUM'; ELEMENT(48)%MASS=112.411_EB
ELEMENT(49)%ABBREVIATION='In'; ELEMENT(49)%NAME='INDIUM'; ELEMENT(49)%MASS=114.818_EB
ELEMENT(50)%ABBREVIATION='Sn'; ELEMENT(50)%NAME='TIN'; ELEMENT(50)%MASS=118.71_EB
ELEMENT(51)%ABBREVIATION='Sb'; ELEMENT(51)%NAME='ANTIMONY'; ELEMENT(51)%MASS=121.76_EB
ELEMENT(52)%ABBREVIATION='Te'; ELEMENT(52)%NAME='TELLURIUM'; ELEMENT(52)%MASS=127.6_EB
ELEMENT(53)%ABBREVIATION='I'; ELEMENT(53)%NAME='IODINE'; ELEMENT(53)%MASS=126.90447_EB
ELEMENT(54)%ABBREVIATION='Xe'; ELEMENT(54)%NAME='XENON'; ELEMENT(54)%MASS=131.293_EB
ELEMENT(55)%ABBREVIATION='Cs'; ELEMENT(55)%NAME='CAESIUM'; ELEMENT(55)%MASS=132.9054519_EB
ELEMENT(56)%ABBREVIATION='Ba'; ELEMENT(56)%NAME='BARIUM'; ELEMENT(56)%MASS=137.327_EB
ELEMENT(57)%ABBREVIATION='La'; ELEMENT(57)%NAME='LANTHANUM'; ELEMENT(57)%MASS=138.90547_EB
ELEMENT(58)%ABBREVIATION='Ce'; ELEMENT(58)%NAME='CERIUM'; ELEMENT(58)%MASS=140.116_EB
ELEMENT(59)%ABBREVIATION='Pr'; ELEMENT(59)%NAME='PRASEODYMIUM'; ELEMENT(59)%MASS=140.90765_EB
ELEMENT(60)%ABBREVIATION='Nd'; ELEMENT(60)%NAME='NEODYMIUM'; ELEMENT(60)%MASS=144.242_EB
ELEMENT(61)%ABBREVIATION='Pm'; ELEMENT(61)%NAME='PROMETHIUM'; ELEMENT(61)%MASS=145_EB
ELEMENT(62)%ABBREVIATION='Sm'; ELEMENT(62)%NAME='SAMARIUM'; ELEMENT(62)%MASS=150.36_EB
ELEMENT(63)%ABBREVIATION='Eu'; ELEMENT(63)%NAME='EUROPIUM'; ELEMENT(63)%MASS=151.964_EB
ELEMENT(64)%ABBREVIATION='Gd'; ELEMENT(64)%NAME='GADOLINIUM'; ELEMENT(64)%MASS=157.25_EB
ELEMENT(65)%ABBREVIATION='Tb'; ELEMENT(65)%NAME='TERBIUM'; ELEMENT(65)%MASS=158.92535_EB
ELEMENT(66)%ABBREVIATION='Dy'; ELEMENT(66)%NAME='DYSPROSIUM'; ELEMENT(66)%MASS=162.5_EB
ELEMENT(67)%ABBREVIATION='Ho'; ELEMENT(67)%NAME='HOLMIUM'; ELEMENT(67)%MASS=164.93032_EB
ELEMENT(68)%ABBREVIATION='Er'; ELEMENT(68)%NAME='ERBIUM'; ELEMENT(68)%MASS=167.259_EB
ELEMENT(69)%ABBREVIATION='Tm'; ELEMENT(69)%NAME='THULIUM'; ELEMENT(69)%MASS=168.93421_EB
ELEMENT(70)%ABBREVIATION='Yb'; ELEMENT(70)%NAME='YTTERBIUM'; ELEMENT(70)%MASS=173.054_EB
ELEMENT(71)%ABBREVIATION='Lu'; ELEMENT(71)%NAME='LUTETIUM'; ELEMENT(71)%MASS=174.9668_EB
ELEMENT(72)%ABBREVIATION='Hf'; ELEMENT(72)%NAME='HAFNIUM'; ELEMENT(72)%MASS=178.49_EB
ELEMENT(73)%ABBREVIATION='Ta'; ELEMENT(73)%NAME='TANTALUM'; ELEMENT(73)%MASS=180.94788_EB
ELEMENT(74)%ABBREVIATION='W'; ELEMENT(74)%NAME='TUNGSTEN'; ELEMENT(74)%MASS=183.84_EB
ELEMENT(75)%ABBREVIATION='Re'; ELEMENT(75)%NAME='RHENIUM'; ELEMENT(75)%MASS=186.207_EB
ELEMENT(76)%ABBREVIATION='Os'; ELEMENT(76)%NAME='OSMIUM'; ELEMENT(76)%MASS=190.23_EB
ELEMENT(77)%ABBREVIATION='Ir'; ELEMENT(77)%NAME='IRIDIUM'; ELEMENT(77)%MASS=192.217_EB
ELEMENT(78)%ABBREVIATION='Pt'; ELEMENT(78)%NAME='PLATINUM'; ELEMENT(78)%MASS=195.084_EB
ELEMENT(79)%ABBREVIATION='Au'; ELEMENT(79)%NAME='GOLD'; ELEMENT(79)%MASS=196.966569_EB
ELEMENT(80)%ABBREVIATION='Hg'; ELEMENT(80)%NAME='MERCURY'; ELEMENT(80)%MASS=200.59_EB
ELEMENT(81)%ABBREVIATION='Tl'; ELEMENT(81)%NAME='THALLIUM'; ELEMENT(81)%MASS=204.3833_EB
ELEMENT(82)%ABBREVIATION='Pb'; ELEMENT(82)%NAME='LEAD'; ELEMENT(82)%MASS=207.2_EB
ELEMENT(83)%ABBREVIATION='Bi'; ELEMENT(83)%NAME='BISMUTH'; ELEMENT(83)%MASS=208.9804_EB
ELEMENT(84)%ABBREVIATION='Po'; ELEMENT(84)%NAME='POLONIUM'; ELEMENT(84)%MASS=210_EB
ELEMENT(85)%ABBREVIATION='At'; ELEMENT(85)%NAME='ASTATINE'; ELEMENT(85)%MASS=210_EB
ELEMENT(86)%ABBREVIATION='Rn'; ELEMENT(86)%NAME='RADON'; ELEMENT(86)%MASS=222_EB
ELEMENT(87)%ABBREVIATION='Fr'; ELEMENT(87)%NAME='FRANCIUM'; ELEMENT(87)%MASS=223_EB
ELEMENT(88)%ABBREVIATION='Ra'; ELEMENT(88)%NAME='RADIUM'; ELEMENT(88)%MASS=226_EB
ELEMENT(89)%ABBREVIATION='Ac'; ELEMENT(89)%NAME='ACTINIUM'; ELEMENT(89)%MASS=227_EB
ELEMENT(90)%ABBREVIATION='Th'; ELEMENT(90)%NAME='THORIUM'; ELEMENT(90)%MASS=232.03806_EB
ELEMENT(91)%ABBREVIATION='Pa'; ELEMENT(91)%NAME='PROTACTINIUM'; ELEMENT(91)%MASS=231.03588_EB
ELEMENT(92)%ABBREVIATION='U'; ELEMENT(92)%NAME='URANIUM'; ELEMENT(92)%MASS=238.02891_EB
ELEMENT(93)%ABBREVIATION='Np'; ELEMENT(93)%NAME='NEPTUNIUM'; ELEMENT(93)%MASS=237_EB
ELEMENT(94)%ABBREVIATION='Pu'; ELEMENT(94)%NAME='PLUTONIUM'; ELEMENT(94)%MASS=244_EB
ELEMENT(95)%ABBREVIATION='Am'; ELEMENT(95)%NAME='AMERICIUM'; ELEMENT(95)%MASS=243_EB
ELEMENT(96)%ABBREVIATION='Cm'; ELEMENT(96)%NAME='CURIUM'; ELEMENT(96)%MASS=247_EB
ELEMENT(97)%ABBREVIATION='Bk'; ELEMENT(97)%NAME='BERKELIUM'; ELEMENT(97)%MASS=247_EB
ELEMENT(98)%ABBREVIATION='Cf'; ELEMENT(98)%NAME='CALIFORNIUM'; ELEMENT(98)%MASS=251_EB
ELEMENT(99)%ABBREVIATION='Es'; ELEMENT(99)%NAME='EINSTEINIUM'; ELEMENT(99)%MASS=252_EB
ELEMENT(100)%ABBREVIATION='Fm'; ELEMENT(100)%NAME='FERMIUM'; ELEMENT(100)%MASS=257_EB
ELEMENT(101)%ABBREVIATION='Md'; ELEMENT(101)%NAME='MENDELEVIUM'; ELEMENT(101)%MASS=258_EB
ELEMENT(102)%ABBREVIATION='No'; ELEMENT(102)%NAME='NOBELIUM'; ELEMENT(102)%MASS=259_EB
ELEMENT(103)%ABBREVIATION='Lr'; ELEMENT(103)%NAME='LAWRENCIUM'; ELEMENT(103)%MASS=262_EB
ELEMENT(104)%ABBREVIATION='Rf'; ELEMENT(104)%NAME='RUTHERFORDIUM'; ELEMENT(104)%MASS=261_EB
ELEMENT(105)%ABBREVIATION='Db'; ELEMENT(105)%NAME='DUBNIUM'; ELEMENT(105)%MASS=262_EB
ELEMENT(106)%ABBREVIATION='Sg'; ELEMENT(106)%NAME='SEABORGIUM'; ELEMENT(106)%MASS=266_EB
ELEMENT(107)%ABBREVIATION='Bh'; ELEMENT(107)%NAME='BOHRIUM'; ELEMENT(107)%MASS=264_EB
ELEMENT(108)%ABBREVIATION='Hs'; ELEMENT(108)%NAME='HASSIUM'; ELEMENT(108)%MASS=267_EB
ELEMENT(109)%ABBREVIATION='Mt'; ELEMENT(109)%NAME='MEITNERIUM'; ELEMENT(109)%MASS=268_EB
ELEMENT(110)%ABBREVIATION='Ds'; ELEMENT(110)%NAME='DARMSTADTIUM'; ELEMENT(110)%MASS=271_EB
ELEMENT(111)%ABBREVIATION='Rg'; ELEMENT(111)%NAME='ROENTGENIUM'; ELEMENT(111)%MASS=282_EB
ELEMENT(112)%ABBREVIATION='Cn'; ELEMENT(112)%NAME='COPERNICIUM'; ELEMENT(112)%MASS=285_EB
ELEMENT(113)%ABBREVIATION='Uut'; ELEMENT(113)%NAME='UNUNTRIUM'; ELEMENT(113)%MASS=284_EB
ELEMENT(114)%ABBREVIATION='Uuq'; ELEMENT(114)%NAME='UNUNQUADIUM'; ELEMENT(114)%MASS=289_EB
ELEMENT(115)%ABBREVIATION='Uup'; ELEMENT(115)%NAME='UNUNPENTIUM'; ELEMENT(115)%MASS=288_EB
ELEMENT(116)%ABBREVIATION='Uuh'; ELEMENT(116)%NAME='UNUNHEXIUM'; ELEMENT(116)%MASS=292_EB
ELEMENT(117)%ABBREVIATION='Uus'; ELEMENT(117)%NAME='UNUNSEPTIUM'; ELEMENT(117)%MASS=295_EB
ELEMENT(118)%ABBREVIATION='Uuo'; ELEMENT(118)%NAME='UNUNOCTIUM'; ELEMENT(118)%MASS=294_EB

END SUBROUTINE MAKE_PERIODIC_TABLE


SUBROUTINE SIMPLE_SPECIES_MW
USE GLOBAL_CONSTANTS,ONLY:MW_N2,MW_O2,MW_CO2,MW_H2O,MW_CO,MW_H2
REAL(EB)::ATOM_COUNTS(118)
CHARACTER(100)::FORMULA

FORMULA='N2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_N2,ATOM_COUNTS)
FORMULA='O2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_O2,ATOM_COUNTS)
FORMULA='CO2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_CO2,ATOM_COUNTS)
FORMULA='H2O'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_H2O,ATOM_COUNTS)
FORMULA='CO'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_CO,ATOM_COUNTS)
FORMULA='H2'
CALL GET_FORMULA_WEIGHT(FORMULA,MW_H2,ATOM_COUNTS)

END SUBROUTINE SIMPLE_SPECIES_MW


RECURSIVE SUBROUTINE GET_FORMULA_WEIGHT(FORMULA,WEIGHT_SUM,ATOM_COUNTS)
USE GLOBAL_CONSTANTS,ONLY:LU_ERR

CHARACTER(3)::ELEMENT_NAME
CHARACTER(100),INTENT(IN)::FORMULA
CHARACTER(100) :: SUBFORMULA
REAL(EB),INTENT(INOUT)::WEIGHT_SUM
REAL(EB),INTENT(INOUT)::ATOM_COUNTS(118)
REAL(EB)::SUB_WEIGHT,NUM
INTEGER :: I,J,LEN1,ELEMENT_INDEX
REAL(EB):: SUBATOM_COUNTS(118)

ATOM_COUNTS = 0._EB
WEIGHT_SUM=0._EB
LEN1 = LEN(TRIM(FORMULA))
I=1

DO WHILE (I <= LEN1) 
   SUBUNIT_SEARCH: IF(ICHAR(FORMULA(I:I))==IACHAR('(')) THEN
      SUBFORMULA=''
      FIND_RIGHT: DO J=I,LEN1
         IF(ICHAR(FORMULA(J:J))==IACHAR(')')) THEN
            WRITE(SUBFORMULA,'(A)') FORMULA(I+1:J-1)
            EXIT FIND_RIGHT
         ENDIF
      ENDDO FIND_RIGHT
      SUB_WEIGHT=0.
      SUBATOM_COUNTS=0._EB
      CALL GET_FORMULA_WEIGHT(SUBFORMULA,SUB_WEIGHT,SUBATOM_COUNTS)
      J=J+1
      CALL GET_ATOM_MULTIPLIER(FORMULA,J,LEN1,NUM)
      WEIGHT_SUM = WEIGHT_SUM + SUB_WEIGHT*NUM
      ATOM_COUNTS=ATOM_COUNTS+SUBATOM_COUNTS*NUM      
      I=J
   ELSE SUBUNIT_SEARCH 
      ELEMENT_NAME = '   '
      IF(IACHAR(FORMULA(I+1:I+1))<=IACHAR('z') .AND. IACHAR(FORMULA(I+1:I+1))>=IACHAR('a')) THEN
         IF(IACHAR(FORMULA(I+2:I+2))<=IACHAR('z') .AND. IACHAR(FORMULA(I+2:I+2))>=IACHAR('a')) THEN
            WRITE(ELEMENT_NAME,'(A)') FORMULA(I:I+2)
            I=I+3
         ELSE
            WRITE(ELEMENT_NAME,'(A)') FORMULA(I:I+1)
            I=I+2
         ENDIF
      ELSE
         WRITE(ELEMENT_NAME,'(A)') FORMULA(I:I)
         I=I+1
      ENDIF
      ELEMENT_INDEX = -1
      ELEMENT_SEARCH: DO J=1,118
         IF(TRIM(ELEMENT_NAME)==TRIM(ELEMENT(J)%ABBREVIATION)) THEN
            ELEMENT_INDEX = J
            EXIT ELEMENT_SEARCH
         ENDIF
      ENDDO ELEMENT_SEARCH
      IF (ELEMENT_INDEX<0) THEN
         WRITE(LU_ERR,'(/A,A,A,A,A)') 'ERROR: Element named ',TRIM(ELEMENT_NAME),' in FORUMLA ',TRIM(FORMULA), ' is not found.'
         STOP      
      ENDIF
      J=I
      CALL GET_ATOM_MULTIPLIER(FORMULA,J,LEN1,NUM)
      WEIGHT_SUM=WEIGHT_SUM+ELEMENT(ELEMENT_INDEX)%MASS*NUM
      ATOM_COUNTS(ELEMENT_INDEX)=ATOM_COUNTS(ELEMENT_INDEX)+NUM
      I=J
   ENDIF SUBUNIT_SEARCH
ENDDO

END SUBROUTINE GET_FORMULA_WEIGHT

SUBROUTINE GET_ATOM_MULTIPLIER(FORMULA,J,LEN1,NUM)
USE GLOBAL_CONSTANTS,ONLY:LU_ERR
CHARACTER(100), INTENT(IN)::FORMULA
INTEGER,INTENT(IN):: LEN1
INTEGER,INTENT(INOUT)::J
INTEGER::I,K
REAL(EB),INTENT(OUT)::NUM

NUM=-1._EB
IF (J>LEN1) THEN
   NUM=1._EB
   RETURN
ENDIF
DO I=J,LEN1
   IF((IACHAR(FORMULA(I:I))>=IACHAR('A') .AND. IACHAR(FORMULA(I:I))<=IACHAR('Z')).OR.IACHAR(FORMULA(I:I))==IACHAR('(')) THEN
      IF (I==J) NUM=1.
      EXIT
   ELSEIF((IACHAR(FORMULA(I:I))<IACHAR('0') .OR. IACHAR(FORMULA(I:I))>IACHAR('9')).AND.IACHAR(FORMULA(I:I))/=IACHAR('.')) THEN
      WRITE(LU_ERR,'(/A,I2,A,A)') 'ERROR: Invalid character in atom multiplier at position ',I,' in FORUMLA for ',TRIM(FORMULA)
      STOP
   ELSE
      K=I
   ENDIF
ENDDO 

IF (NUM < 0._EB) READ(FORMULA(J:K),*) NUM

J=I

END SUBROUTINE GET_ATOM_MULTIPLIER


SUBROUTINE PARSE_EQUATION(NR)
USE GLOBAL_CONSTANTS, ONLY :N_SPECIES
USE TYPES, ONLY: REACTION_TYPE,REACTION
INTEGER, INTENT(IN) :: NR
CHARACTER(100)::FORMULA
INTEGER :: I,J,K,LEN1,SPEC_PTR
LOGICAL :: LHS
TYPE(REACTION_TYPE),POINTER::RN=>null()

RN => REACTION(NR)

CALL CHECK_REACTION_CHARACTERS(RN%EQUATION)

LHS=.TRUE.
LEN1 = LEN(TRIM(RN%EQUATION))
I=1
SPEC_PTR=0
DO WHILE (I <= LEN1)
   CALL GET_NU(RN%EQUATION,I,LEN1,RN%NU_READ(SPEC_PTR+1))
   IF (LHS) RN%NU_READ(SPEC_PTR+1) = -RN%NU_READ(SPEC_PTR+1)
   DO J=I,LEN1
      IF(IACHAR(RN%EQUATION(J:J))==IACHAR('+') .OR. IACHAR(RN%EQUATION(J:J))==IACHAR('=')) THEN
         IF(IACHAR(RN%EQUATION(J:J))==IACHAR('=')) LHS=.FALSE.
         K = J - 1
         EXIT
      ENDIF
      K=J
   ENDDO
   FORMULA=''
   WRITE(FORMULA(1:K-I+1),'(A)') RN%EQUATION(I:K)
   RN%SMIX_ID_READ(SPEC_PTR+1) = FORMULA
   SPEC_PTR = SPEC_PTR + 1
   I = K+2
END DO

END SUBROUTINE PARSE_EQUATION


SUBROUTINE GET_NU(EXPRESSION,J,LEN1,NU)
USE GLOBAL_CONSTANTS, ONLY:LU_ERR
CHARACTER(255), INTENT(IN)::EXPRESSION
INTEGER,INTENT(IN):: LEN1
INTEGER,INTENT(INOUT)::J
INTEGER::I,K
REAL(EB),INTENT(OUT)::NU

NU=-1._EB
IF (J>LEN1) THEN
   NU=1._EB
   RETURN
ENDIF
DO I=J,LEN1
   IF(IACHAR(EXPRESSION(I:I))==IACHAR('*')) THEN
      IF(I==J) THEN
         WRITE(LU_ERR,'(A)') 'Equation:'//TRIM(EXPRESSION)  
         WRITE(LU_ERR,'(A,I0)') 'ERROR: No number before * at position ',I
         STOP     
      ELSE
         K=I-1
         EXIT
      ENDIF
   ELSEIF((IACHAR(EXPRESSION(I:I))<IACHAR('0') .OR. IACHAR(EXPRESSION(I:I))>IACHAR('9')).AND.&
           IACHAR(EXPRESSION(I:I))/=IACHAR('.')) THEN
      IF(I==J) THEN
         NU=1._EB
         K=J-1
         EXIT
      ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR(',') .OR. IACHAR(EXPRESSION(I:I))==IACHAR('-')) THEN
         NU=1._EB
         K=J-1
         EXIT
      ELSE
         WRITE(LU_ERR,'(A)') 'Equation:'//TRIM(EXPRESSION)        
         WRITE(LU_ERR,'(A,I0)') 'ERROR: Invalid character in nu at position ',I
         STOP
      ENDIF
   ENDIF
ENDDO 

IF (NU < 0._EB) READ(EXPRESSION(J:K),*) NU
J=K+1
IF (IACHAR(EXPRESSION(J:J))==IACHAR('*')) J=J+1

END SUBROUTINE GET_NU


SUBROUTINE CHECK_REACTION_CHARACTERS(EXPRESSION)
USE GLOBAL_CONSTANTS, ONLY:LU_ERR
CHARACTER(255),INTENT(IN)::EXPRESSION
INTEGER :: I,LEN1

LEN1=LEN(TRIM(EXPRESSION))

DO I=1,LEN1
  IF(IACHAR(EXPRESSION(I:I))>=IACHAR('A') .AND. IACHAR(EXPRESSION(I:I))<=IACHAR('Z')) THEN
     CYCLE
  ELSEIF(IACHAR(EXPRESSION(I:I))>=IACHAR('a') .AND. IACHAR(EXPRESSION(I:I))<=IACHAR('z')) THEN
     CYCLE     
  ELSEIF(IACHAR(EXPRESSION(I:I))>=IACHAR('0') .AND. IACHAR(EXPRESSION(I:I))<=IACHAR('9')) THEN
     CYCLE     
  ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR('+').OR.IACHAR(EXPRESSION(I:I))==IACHAR('=').OR.IACHAR(EXPRESSION(I:I))==IACHAR('.')) THEN
     CYCLE
  ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR('(').OR.IACHAR(EXPRESSION(I:I))==IACHAR(')').OR.IACHAR(EXPRESSION(I:I))==IACHAR('*')) THEN
     CYCLE
  ELSEIF(IACHAR(EXPRESSION(I:I))==IACHAR(' ').OR.IACHAR(EXPRESSION(I:I))==IACHAR(',').OR.IACHAR(EXPRESSION(I:I))==IACHAR('-')) THEN
     CYCLE
  ELSE
     WRITE(LU_ERR,'(A)') 'Equation:'//TRIM(EXPRESSION)  
     WRITE(LU_ERR,'(A,I0)') 'ERROR: Invalid Character in REAC expression at position ',I
     STOP
  ENDIF
ENDDO

END SUBROUTINE CHECK_REACTION_CHARACTERS


SUBROUTINE SHUTDOWN_ATOM(ATOM_COUNT,NR,ERR)  

! Stops the code gracefully after writing a message

USE GLOBAL_CONSTANTS, ONLY: LU_ERR,FN_OUTPUT,LU_OUTPUT,CHID
INTEGER, INTENT(IN) :: NR
INTEGER :: I
REAL(EB), INTENT(IN) :: ATOM_COUNT(118),ERR
LOGICAL :: EX

WRITE(LU_ERR,'(/A,I3,A)') 'ERROR: Problem with REAC ',NR,'. Unbalanced stoichiometry.'
WRITE(LU_ERR,'(/A)') 'The following elements are unblanced:'
WRITE(LU_ERR,'(/A)') 'Element  Atom Error'

DO I=1,118
   IF (ABS(ATOM_COUNT(I)) > ERR) WRITE(LU_ERR,'(2X,A,4X,E10.3)') ELEMENT(I)%ABBREVIATION,ATOM_COUNT(I)
ENDDO
! For those running FDS on a PC, ensure that error message gets written to the .out file, too.

INQUIRE(FILE=FN_OUTPUT,EXIST=EX)
IF (.NOT.EX) OPEN(LU_OUTPUT,FILE=TRIM(CHID)//'.out',STATUS='REPLACE',FORM='FORMATTED')

WRITE(LU_OUTPUT,'(/A,I3,A)') 'ERROR: Problem with REAC ',NR,'. Unbalanced stoichiometry.'
WRITE(LU_OUTPUT,'(/A)') 'The following elements are unblanced:'
WRITE(LU_OUTPUT,'(/A)') 'Element  Atom Error'
DO I=1,118
   IF (ABS(ATOM_COUNT(I)) > ERR) WRITE(LU_OUTPUT,'(2X,A,4X,E10.3)') ELEMENT(I)%ABBREVIATION,ATOM_COUNT(I)
ENDDO

STOP

END SUBROUTINE SHUTDOWN_ATOM


END MODULE PROPERTY_DATA
